Class

io.scalajs.nodejs.cluster

ClusterEvents

Related Doc: package cluster

Permalink

implicit final class ClusterEvents extends AnyVal

Cluster Events

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

Instance Constructors

  1. new ClusterEvents(cluster: Cluster)

    Permalink

    cluster

    the given cluster

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val cluster: Cluster

    Permalink

    the given cluster

  6. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  7. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  8. def onDisconnect(callback: (Worker) ⇒ Any): cluster.type

    Permalink

    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()
  9. def onExit(callback: (Worker, Int, String) ⇒ Any): cluster.type

    Permalink

    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()
  10. def onFork(callback: (Worker) ⇒ Any): cluster.type

    Permalink

    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()
  11. def onListening(callback: (Worker, Address) ⇒ Any): cluster.type

    Permalink

    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()
  12. def onMessage(callback: (Worker, Message, Any) ⇒ Any): cluster.type

    Permalink

    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()
  13. def onOnline(callback: (Worker) ⇒ Any): cluster.type

    Permalink

    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()
  14. def onSetup(callback: (ClusterSettings) ⇒ Any): cluster.type

    Permalink

    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()
  15. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped