@infect/rda-service-manager

2.1.2 • Public • Published

RDA Service Manager

starting and stopping RDA services

API

import ServiceManager from '@infect/rda-service-manager';

// pass the args that need to be passed to the processes
// running the service to the service manager
const manager = new ServiceManager({
    args: '--dev --log-level=error+ --log-module=*'.split(' ')
});


// start services by their name. the service manager is looking for 
// them in the node_modules and in the local file system on the same
// level as the project the service manager is executed in
await sm.startServices('rda-service-registry');

// stop a specific service, if no parameters are passed all services
// are stopped
await sm.stopServices('rda-service-registry');

Constructor

The constructor accepts an array with command line paramters that are then passed to the child processes starting services.

const manager = new ServiceManager({
    args: '--dev --log-level=error+ --log-module=*'.split(' ')
});

manager.startServices()

Starts services in the order passed to this function. the service manager is looking for the services in the node_modules and in the local file system on the same level as the project the service manager is executed in

await sm.startServices(serviceName[, serviceName, [...]]);

manager.stopServices()

Stops the services that have one of the names passed to the method. If no name is passed all services are stopped. Services are stopped in the reverse order they were started.

await sm.stopServices(serviceName[, serviceName, [...]]);

Readme

Keywords

Package Sidebar

Install

npm i @infect/rda-service-manager

Weekly Downloads

0

Version

2.1.2

License

MIT

Unpacked Size

16.6 kB

Total Files

10

Last publish

Collaborators

  • ee
  • fxstr
  • tobiaskneubuehler