Scala: the global ExecutionContext makes your life easier

TL;DR – when in doubt, stick with scala.concurrent.ExecutionContext.global When you want to run some asynchronous code, choosing a thread pool isn’t any fun. Scala has your back, with its global ExecutionContext. When I try to put some code in a Future without specifying where to run it, Scala tells me what to do: scala> Future(println(“Do something slow”)):14: …

Read moreScala: the global ExecutionContext makes your life easier

Testing akka: turn on debug

Testing is easier when you can see what messages are received by your actors. To do this, add logging to your real code, and then change your configuration. This post shows how to hard-code some debugging configuration for testing purposes. Step 1: put logging into your receive method, by wrapping your existing receive definition in …

Read moreTesting akka: turn on debug