Extend Bree from EventEmitter and emit events when workers start, etc
See original GitHub issueI want to call the method in the main thread in the worker, and I found comlink will be a good choice, but I don’t know how to use it with bree.
I need to call Comlink.wrap(worker)
whenever bree starts a new worker, but there is no hooks or event to listen to. 🤔
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Bree is a Node.js and JavaScript job task scheduler ... - GitHub
Listening for events. Bree extends from EventEmitter and emits two events: worker created with an argument of name; worker deleted with ...
Read more >Using Event Emitters in Node.js - DigitalOcean
Event emitters are objects in Node.js that trigger an event by sending a message to signal that an action was completed.
Read more >Extend EventEmitter and call emit - typescript - Stack Overflow
The error is because you are passing one argument to emit , which declares zero parameters. There is another problem. The signature of...
Read more >EventEmitter - Angular
Creates an instance of this class that can deliver events synchronously or asynchronously. This class is "final" and should not be extended.
Read more >Event Emitters and Event Targets- Scaler Topics
The emit() method is used to raise specified events with the supplied arguments. All the registered event listeners are called synchronously. It ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
v1.1.17 released to npm with this added:
https://github.com/breejs/bree/releases/tag/v1.1.17
See the README for more information and examples on how to listen for when they start:
https://github.com/breejs/bree#listening-for-events
Let us know if you need anything else.
Here is an example used with comlink.