Constructor
new Communicator(path)
Responsible for communicating with webworkers.
Additional documentation can be found in the GitHub repository.
Parameters:
| Name | Type | Description |
|---|---|---|
path |
String | is the path to the specified file |
- Source:
Methods
sendMessage(action, payload, cb)
Sends a message to the Worker
Parameters:
| Name | Type | Description |
|---|---|---|
action |
String | |
payload |
object | |
cb |
function |
- Source:
subscribe(event, cb)
Starts listening to broadcast events
Parameters:
| Name | Type | Description |
|---|---|---|
event |
string | |
cb |
function |
- Source:
terminate()
Terminates the worker and shuts down communication
- Source:
unsubscribe(event, cb)
Quits listening to Broadcast events
Parameters:
| Name | Type | Description |
|---|---|---|
event |
string | |
cb |
function |
- Source: