Shutdown actor system with blocking calls

I wouldn’t shutdown all dispatchers this way. Since it’s blocking tasks those should run on dedicated dispatchers anyway, and those specific dispatchers could be shutdown like this.

There is no public API for accessing the executor service but it can be done like this:

scala> val d = system.asInstanceOf[ExtendedActorSystem].dispatchers.lookup("akka.actor.default-blocking-io-dispatcher")
d: akka.dispatch.MessageDispatcher = Dispatcher[akka.actor.default-blocking-io-dispatcher]

scala> val d2 = d.asInstanceOf[akka.dispatch.Dispatcher]
d2: akka.dispatch.Dispatcher = Dispatcher[akka.actor.default-blocking-io-dispatcher]

scala> val m = classOf[akka.dispatch.Dispatcher].getDeclaredMethod("executorService")
m: java.lang.reflect.Method = public final akka.dispatch.ExecutorServiceDelegate akka.dispatch.Dispatcher.executorService()

scala> val executorService = m.invoke(d2).asInstanceOf[java.util.concurrent.ExecutorService]
executorService: java.util.concurrent.ExecutorService = akka.dispatch.Dispatcher$LazyExecutorServiceDelegate@50af4885

scala> executorService.shutdownNow()