playframework/playframework — pull request #1089 by richdougherty (2013-08-14 06:11:14+00:00)
Title: Execute trivial iteratee code on same thread

Most iteratee code is configured to run in the default iteratee ExecutionContext—currently a ForkJoinPool. For trivial code, which take a small and bounded amount of time we can run them in an ExecutionContext that executes on the same thread.

But we need be careful we don't do anything too expensive when executing on the same thread, as we don't own the thread. We should also avoid executing code that could result in a stack overflow.