CentralWorker

CentralWorker

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

Constructor

new CentralWorker(name, handler, readTimeout)

Description:
  • Constructor

Source:
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 15000

how much ms to wait until rejecting

Methods

attach() → {object}

Description:
  • Start listening to IPC events

Source:
Returns:

self

Type
object

date(date) → {string}

Description:
  • Unique frame date generator

Source:
Parameters:
Name Type Description
date any

date to use

Returns:

packet date with worker pid

Type
string

detach()

Description:
  • Detach IPC request listener

Source:

request(data) → {Promise}

Description:
  • Send request to the Central with a promise

Source:
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)

Description:
  • Send message to the Central

Source:
Parameters:
Name Type Description
data any

data to send to master process