0.2.2 • Published 3 years ago

simple-task-manager v0.2.2

Weekly downloads
5
License
MIT
Repository
github
Last release
3 years ago

Simple Task Manager

This is a sample project. To get started:

$ npm i simple-task-manager
  • Task
  • Scheduler
  • Manager
  • Worker

How to handle multiple workers for a single queue in distributed machines/processes? Claim a task

We schedule a task to run. Execute task, increase run count when done.

  • A task can be scheduled to be run immediately
    • ttl === 0
  • A task can be scheduled to be run at a later date
    • ttl > 0
  • A task can be run once
    • maxRuns === 0
  • A task can be run multiple times

    • maxRuns > 0
  • After an error a task can be retried if:

    • We have not gone over our tries maxTries < errorCount
  • A task can be assigned a timeout period to run

    • timeout
  • A task should have a timeout for execution time

  • If we start queue and worker exits the task will not be picked up by worker. We need to be able to pick up timedout tasks and requeue them, using scheduler.

TODO

License

® License MIT by goliatone