Packages

c

io.scalajs.nodejs.cluster

ClusterEvents

implicit final class ClusterEvents extends AnyVal

Cluster Events

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClusterEvents
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ClusterEvents(cluster: Cluster)

    cluster

    the given cluster

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  7. def onDisconnect(callback: (Worker) => Any): Cluster

    Emitted after the worker IPC channel has disconnected.

    Emitted after the worker IPC channel has disconnected. This can occur when a worker exits gracefully, is killed, or is disconnected manually (such as with worker.disconnect()).

    There may be a delay between the 'disconnect' and 'exit' events. These events can be used to detect if the process is stuck in a cleanup or if there are long-living connections.

    callback

    the event handler

    Annotations
    @inline()
  8. def onExit(callback: (Worker, Int, String) => Any): Cluster

    Similar to the cluster.on('exit') event, but specific to this worker.

    Similar to the cluster.on('exit') event, but specific to this worker.

    callback

    the event handler <il>worker <Worker> the worker

    • code <Number> the exit code, if it exited normally.
    • signal <String> the name of the signal (eg. 'SIGHUP') that caused the process to be killed.
    Annotations
    @inline()
  9. def onFork(callback: (Worker) => Any): Cluster

    When a new worker is forked the cluster module will emit a 'fork' event.

    When a new worker is forked the cluster module will emit a 'fork' event. This can be used to log worker activity, and create your own timeout.

    callback

    the event handler

    Annotations
    @inline()
  10. def onListening(callback: (Worker, Address) => Any): Cluster

    After calling listen() from a worker, when the 'listening' event is emitted on the server, a 'listening' event will also be emitted on cluster in the master.

    After calling listen() from a worker, when the 'listening' event is emitted on the server, a 'listening' event will also be emitted on cluster in the master.

    The event handler is executed with two arguments, the worker contains the worker object and the address object contains the following connection properties: address, port and addressType. This is very useful if the worker is listening on more than one address.

    callback

    the event handler

    Annotations
    @inline()
  11. def onMessage(callback: (Worker, Message, Any) => Any): Cluster

    Emitted when any worker receives a message.

    Emitted when any worker receives a message. See child_process event: 'message'.

    Before Node.js v6.0, this event emitted only the message and the handle, but not the worker object, contrary to what the documentation stated.

    callback

    the event handler

    Annotations
    @inline()
  12. def onOnline(callback: (Worker) => Any): Cluster

    After forking a new worker, the worker should respond with an online message.

    After forking a new worker, the worker should respond with an online message. When the master receives an online message it will emit this event. The difference between 'fork' and 'online' is that fork is emitted when the master forks a worker, and 'online' is emitted when the worker is running.

    callback

    the event handler

    Annotations
    @inline()
  13. def onSetup(callback: (ClusterSettings) => Any): Cluster

    Emitted every time .setupMaster() is called.

    Emitted every time .setupMaster() is called. The settings object is the cluster.settings object at the time .setupMaster() was called and is advisory only, since multiple calls to .setupMaster() can be made in a single tick.

    If accuracy is important, use cluster.settings.

    callback

    the event handler

    Annotations
    @inline()
  14. def toString(): String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped