I’m trying to set up a dispatcher that will be used exclusively for blocking IO and I seem to be having troubles with that.
As far as I can tell, every dispatcher that I fetch via the
Dispatchers.lookup method is implementing
MessageDispatcher which in turn extends
BatchingExecutor. In the documentation of
BatchingExecutor it says that:
A batching executor can create deadlocks if code does not use
scala.concurrent.blockingwhen it should, because tasks created within other tasks will block on the outer task completing.
Since the dispatcher I’m trying to create is intended for blocking IO, batching is not a behavior that I want to have. If I’m running with the
BatchingExecutor, it seems that I would have to wrap every single call made through it with
blocking. This is something that I would like to avoid.
Is there a way to have a dispatcher that doesn’t use batching? Some configuration value that can be tweaked? Or am I missing something, and batching shouldn’t be an obstacle even for a blocking IO dispatcher?