Open flipswitchingmonkey opened 1 year ago
The functionality here is crucial for my team to use this package. This PR appears to have been abandoned, and now unsurprisingly conflicts greatly. @josdejong what would be your level of interest in re-approaching this?
@blordpluto thanks for your input. I would love to see this feature finished. The PR was under review but not yet there. Would you be interested in creating a new PR implementing this feature?
This PR is related to https://github.com/josdejong/workerpool/issues/370
A rather small change that adds a second parameter to
workerpool.worker()
function, which accepts an object where each key is the receiver's name of an event, plus a payload.It also adds an emit() function to the Promise object which will send a postMessage() call to the worker instance.
These changes should be non-breaking.
Example: workers/myworker.js
And to call the event: