npm.io
0.2.2 • Published 5 years ago

simple-task-manager

Licence
MIT
Version
0.2.2
Deps
6
Size
49 kB
Vulns
0
Weekly
0

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