async_job

0.0.6 • Public • Published

async_job

async_job is a work in progress. It is a similar implementation to the ruby library called resque, but isn't an exact copy.

Run async_job init to create the config files

> async_job init
Generating async_job config

Run async_job generate workerName to a new worker in your worker directory

> async_job generate workerName
Generating async_job worker
What a job looks like:

Export a function called perform that the runner can call. Your function will receive two arguments, args and exit, use the args to pass varibles to your work and call exit(0) (Or whateve exit code is appropriate) when your task is finished.

exports.perform = function(args, exit) {
  console.log(args)

  exit(0)
}

Run async_job like this.

async_job -c 8

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i async_job

Weekly Downloads

4

Version

0.0.6

License

MIT

Last publish

Collaborators

  • ussballantyne