Messenger

Messenger

Communication between app worker and agent worker by IPC channel

Constructor

new Messenger()

Source:

Methods

broadcast(action, data) → {Messenger}

Send message to all agent and app

Parameters:
Name Type Description
action String

message key

data Object

message value

Source:

send(action, data, to) → {Messenger}

Parameters:
Name Type Description
action String

message key

data Object

message value

to String

let master know how to send message

Source:

sendRandom(action, data) → {Messenger}

send message to one app worker by random

  • if it's running in agent, it will send to one of app workers
  • if it's running in app, it will send to agent
Parameters:
Name Type Description
action String

message key

data Object

message value

Source:

sendTo(pid, action, data) → {Messenger}

send message to the specified process

Parameters:
Name Type Description
pid String

the process id of the receiver

action String

message key

data Object

message value

Source:

sendToAgent(action, data) → {Messenger}

send message to agent

Parameters:
Name Type Description
action String

message key

data Object

message value

Source:

sendToApp(action, data) → {Messenger}

send message to app

Parameters:
Name Type Description
action String

message key

data Object

message value

Source: