WebReflection / coincident

An Atomics based Proxy to simplify, and synchronize, Worker related tasks.
MIT License
201 stars 3 forks source link

Allowed same logic from main -> thread #5

Closed WebReflection closed 1 year ago

WebReflection commented 1 year ago

So far this module offers a super easy way to block from a worker but it doesn't offer a way to expose a function in the worker and resolve it on the main thread.

This MR allows that with the only caveat that the main thread needs to await the worker, otherwise it'd be blocked.