sequentio

0.0.2 • Public • Published

Sequentio

Sequentio manages a multiprocessed node app and gives you the ability to run initialization logic before your cluster workers start.

It also allows you to start long running child processes in parallel with your http workers.

const Sequentio = require('sequentio')
const sequentio = new Sequentio()

sequentio.initialize((done) => {
  migrateMyDatabase((err) => {
    done(err)
  })
})

// if a worker crashes within that delay (in milliseconds), it won't be restarted.
//   set it to -1 to disable
//   default delay is 30 seconds
sequentio.setCrashToleranceDelay(10 * 1000) 
sequentio.worker(path.join(__dirname, 'lib/myWebServer.js'), os.cpus().length)
sequentio.worker(path.join(__dirname, 'lib/myLongRunningCronJob.js'), 1)
sequentio.start()

Package Sidebar

Install

npm i sequentio

Weekly Downloads

1

Version

0.0.2

License

Apache-2.0

Unpacked Size

9.74 kB

Total Files

8

Last publish

Collaborators

  • nherment