diogenes-electrician

6.0.0 • Public • Published

diogenes-electrician

This is an adapter for using electrician components in Diogenes.

addElectricComponents

It adds a set of electric components to 2 Diogenes registry. The first one can be used to start the services in order, the second one to stop them in the opposite order.

var diogenesElectrician = require('diogenes-electrician');
var Diogenes = require('diogenes');
 
var registry = Diogenes.getRegistry();
var stopRegistry = Diogenes.getRegistry();
// components is an object name->electrician component
diogenesElectrician.addElectricComponents(registry, stopRegistry, components);

Then you can start a component using the diogenes "registry" API:

registry.run('componentName', function (err, res) {
  // ...
});

and stop with:

stopRegistry.run('componentName', function (err, res) {
  // ...
});

system

It emulates the electrician "system" api:

var diogenesElectrician = require('diogenes-electrician');
var system = diogenesElectrician.system(components);
 
system.start(function () {
  // ...
});

and stop:

system.stop(function () {
  // ...
});

/diogenes-electrician/

    Package Sidebar

    Install

    npm i diogenes-electrician

    Weekly Downloads

    0

    Version

    6.0.0

    License

    MIT

    Unpacked Size

    12.3 kB

    Total Files

    11

    Last publish

    Collaborators

    • sithmel