CentralSuper

CentralSuper

Base class for promise-based IPC

Constructor

new CentralSuper(name, handler)

Source:

Constructor

Parameters:
Name Type 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 worker as a reply

Methods

fromMe(data, date, reply, error) → {Object}

Source:

Create a message out of supplied params

Parameters:
Name Type Description
data Any

data to send

date Long

date of the message

reply Boolean

whether this message is a reply

error String

if any

Returns:

message object

Type
Object

isForMe(m) → {Boolean}

Source:

Returns whether the message is for this channel instance

Parameters:
Name Type Description
m Object

message

Returns:

true if for this channel

Type
Boolean