godaddy / node-cluster-service

Turn your single process code into a fault-resilient, multi-process service with built-in REST & CLI support. Restart or hot upgrade your web servers with zero downtime or impact to clients.

Home Page:https://www.npmjs.org/package/cluster-service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support idle (no workers) mode

asilvas opened this issue · comments

In some cases it may be valuable to have cservice ready and running even prior to starting workers, be it as a daemon, for CI/CD, or otherwise.

As of now, when you start cservice, worker path defaults to "worker.js". this should not change for backward compatibility. But if the worker is not found, it can either automatically go into "idle" mode (with a warning that the worker was not found), or require a new option "idle: true".

How to "shutdown all" without exiting? Default path should remain. But perhaps "shutdown workers" can be added in the case you want to shut down all workers but not exit the master.