CentralWorker

CentralWorker

Countly master process, just pass through messages to specific pid in to field of message

Constructor

new CentralWorker(name, handler, readTimeout)

Source:

Constructor

Parameters:
Name Type Default Description
name string

A parameter name used to uniquely identify a message for this Central

handler function

function to process incoming messages return value of this function is sent back to the master as a reply

readTimeout integer 5000

how much ms to wait until rejecting

Methods

attach() → {object}

Source:

Start listening to IPC events

Returns:

self

Type
object

request(data) → {Promise}

Source:

Send request to the Central with a promise

Parameters:
Name Type Description
data any

data to send to master process

Returns:

which either resolves to the value returned by Central, or rejects with error from master / timeout from current process

Type
Promise

send(data)

Source:

Send message to the Central

Parameters:
Name Type Description
data any

data to send to master process