worker.disconnect()

The cluster method that tells a worker to stop accepting new connections, finish its current ones and then exit.

In more detail

worker.kill() instead ends the process at once with a signal. The worker emits disconnect when its IPC channel closes and exit when the process ends.

Related terms

Taught in

References