Master Namespace


Sub-namespaces


Classes


IPC

constructor

With the help of this method you can create a new instance of IPC.

Signature

constructor(Object master) : Object

Parameters

  • master
    • Master Object to bind upon
    • Type: Object

Returns

  • Object
    • Master Object to bind upon

addProcess

Add a given process to the IPC pool.

Signature

addProcess(Object proc) : void

Parameters

  • proc
    • Worker object to add
    • Type: Object

removeProcess

Remove an worker by process-id from the IPC pool.

Signature

removeProcess(Integer pid) : void

Parameters

  • pid
    • Process-Id of the worker to remove
    • Type: Integer

addMethod

Add an method to the IPC stack.

Signature

addMethod(String name, Function method) : void

Parameters

  • name
    • Name of the method
    • Type: String
  • method
    • Function which should be called on request
    • Type: Function

request

Do an request to an registered worker process on the IPC pool.

Signature

request(Integer pid, String name, Mixed args) : void

Parameters

  • pid
    • Process-Id of the worker to remove
    • Type: Integer
  • name
    • Name of the method
    • Type: String
  • args
    • Argument(s) to pass to the method, Objects are prefered
    • Type: Mixed

respond

Respond to a given request message.

Signature

respond(Object message, Mixed error, Mixed result) : void

Parameters

  • message
    • Request message object
    • Type: Object
  • error
    • Error if any occured
    • Type: Mixed
  • result
    • Result of the operation
    • Type: Mixed

call

Low-level call of Node.js process communication API. It simply wraps the "process.send()" method.

Signature

call(Integer pid, Object message) : void

Parameters

  • pid
    • Process-Id of the worker to remove
    • Type: Integer
  • message
    • Message object to send
    • Type: Object

broadcast

Broadcast a message with args if needed to all registered workers on the IPC pool.

Signature

broadcast(String name, Mixed args) : void

Parameters

  • name
    • Process-Id of the worker to remove
    • Type: String
  • args
    • Message object to send
    • Type: Mixed