bennidi / mbassador

Powerful event-bus optimized for high throughput in multi-threaded applications. Features: Sync and Async event publication, weak/strong references, event filtering, annotation driven
MIT License
955 stars 146 forks source link

Shared Message Dispatcher thread pool #141

Open danduff opened 8 years ago

danduff commented 8 years ago

I'm creating a number of Async EventBuses. The HandlerInvocation has the option to provide it with a threadpool (which I have shared across all EventBuses), however for every Bus created a new Dispatch thread is created which is specific to each Bus. This means I can't have a fixed limit of thread creation other than limiting the number of Buses that are created. Is there a reason why the Dispatcher can't use a thread pool which could be shared the same way as the HandlerInvocation?

bennidi commented 8 years ago

No there isn't. This requirement simply did not occur to me. You are welcome to provide a PR that enables this feature. P.S. Only well-tested code is accepted :)