bennidi/mbassador

Shared Message Dispatcher thread pool

Opened this issue · 1 comments

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?

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 :)