0.1.2 • Published 6 years ago

forever-task v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Forever Task

  • Forever task is a task which only stops when receiving stop signal. While running, it emits some data.
  • Forever tasks include crawling, micro service, etc
  • Allow distributed workers

Installation

$ npm install forever-task

Usage

1. Worker

const { Forever } = require('forever-task')
const forever = new Forever()
forever.process({
  MyId: {
    resolver(_, { send }) {
      send({ ping: true })
    }
  }
})

2. start/stop Worker

const jobId = forever.start('MyId')
// stop
forever.stop(jobId)

3. ubscribe/unsubscribe to data

const subId = forever.subscribe('MyId')
// unsubscribe
forever.unsubscribe(subId)
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.8

6 years ago

0.0.6

6 years ago

0.0.4

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago