Start and stop services dependent on one another in order
Usage
1. Define Individual Services
// services/d.jsexportdefault{dependsOn: ['a','b','c'],// Services which must be started prior to this servicestart: ()=>{},// Start up function, called when this service is startedstop: ()=>{}// Teardown function, called when this service is stopped};
2. Initialize Bootman with Defined Services
// services/index.jsimportbootmanfrom'bootman';importafrom'services/a.js';importbfrom'services/b.js';importcfrom'services/c.js';importdfrom'services/d.js';exportdefaultbootman({ a, b, c, d });
3. Start or Stop Services
Start
importservicesfrom'services/index.js';exportdefaultservices.start(['d']);/* In this particular example, since service d dependsOn services a, b, and c, all three of those services must be in a "started" state before service d will be started. The .start and .stop functions accepts either an individual name, i.e. 'd' or an array of names, i.e. ['d', 'c', 'b', 'a'].*/
Stop
// Stop a serviceimportservicesfrom'services/index.js';exportdefaultservices.stop(['d']);
About
Start (and stop) services dependent on one another in order