Open Wansmer opened 3 years ago
Example of alternative implementation: https://github.com/virpool/noroutine/commit/de553bb7287c3c7bec876e6c2dab803cddf3affd
Based on concept from https://github.com/josdejong/workerpool/blob/143b89b6909b07b8cdf72fe5813f96b3e6d38b5c/src/worker.js#L99-L102
Is your feature request related to a problem? Please describe.
Now methods of modules can work with with primitives and objects only, bun no with a functions.
Code below throw Error, because
postMessage
no work with function:Describe the solution you'd like
There an idea of implementation with
vm
: https://github.com/Wansmer/noroutine/pull/1But there is open questions:
os
andfs
for safety or user must make decision himself? (set flags in options or generate and pass own context, for example);eval
in this case will be better and lighter solution insteadvm.Script
?