ES6 Proxies with Comlink #2

Merged
vlw merged 0 commits from refs/pull/2/head into master 2021-11-10 14:48:15 +01:00
vlw commented 2021-11-10 10:55:07 +01:00 (Migrated from codeberg.org)

Abstracting MessageEvent

Replaced direct calls to postMessage() to communicate between the initiator- and worker threads with the RPC-like library Comlink.

TASK will be unaffected

Comlink's proxying causes an ever so slight performance drop that can be avoided by running the TASK event (emitted by the worker) directly throught postMessage(). This event is unidirectional and doesn't [need to] wait for an acknowledgement from the parent. This UDP-like behaviour makes Comlink potentially overkill.

postMessage(["TASK",[0,"someMethod","someArgument"]]);
## Abstracting `MessageEvent` Replaced direct calls to `postMessage()` to communicate between the initiator- and worker threads with the RPC-like library [`Comlink`](https://github.com/GoogleChromeLabs/comlink). ## `TASK` will be unaffected Comlink's proxying causes an ever so slight performance drop that can be avoided by running the `TASK` event (emitted by the worker) directly throught `postMessage()`. This event is unidirectional and doesn't [need to] wait for an acknowledgement from the parent. This UDP-like behaviour makes Comlink potentially overkill. ```js postMessage(["TASK",[0,"someMethod","someArgument"]]); ```
Commenting is not possible because the repository is archived.
No description provided.