2.0.0 • Published 2 years ago

systemic-service-runner v2.0.0

Weekly downloads
525
License
ISC
Repository
github
Last release
2 years ago

NPM version NPM downloads Node.js CI Maintainability Test Coverage Code Style systemic-service-runner Discover zUnit

Systemic Service Runner

Starts systemic systems

TL;DR

const Systemic = require('systemic');
const runner = require('systemic-service-runner');

const system = new Systemic().add('config', { foo: 1, bar: 2 }).add('app', require('./my-app')).dependsOn('config');

runner(system).start((err, components) => {
  if (err) throw err;
  console.log('Started');
});

Features

  • Attempts to shutdown gracefully on error, unhandled rejection, SIGINT and SIGTERM events
  • Attempts a graceful restart when process emits a systemic_restart event

Usage

runner(<system>, [<options>]).start(<cb>)

Default options

{
    logger: console,
    restart: {
        window: '60s'
    }
}