Worker.onMessage
JS
Worker.onMessage(function callback)Listens for the event of messages sent to the current thread by the main thread / worker thread.
Parameters
- function callback: Callback function for the event of messages sent to the current thread by the main thread / worker thread.
Parameters of the callback function
- Object res: Returns the message sent to the current thread by the main thread / worker thread.
Properties of res:
| Property | Value Type | Description |
|---|---|---|
| message | Object | The message sent to the current thread by the main thread / worker thread |
