When a worker process is forked, a new Worker
object is created in both the master and worker processes. In the worker process, the Worker
object is used to represent the current worker and interact with cluster events that are occurring. In the master process, the Worker
object is used to represent child worker processes so that your master application can send messages to them, receive events on their state changes, and even kill them.
Table 9.12 lists the events that Worker
objects can emit.
Table 9.13 lists the methods and properties you can use with Worker
objects to get information such as whether the node is a worker or the master as well as to configure and implement the forked processes.