slick/slick — pull request #996 by szeiger (2014-09-29 15:35:04+00:00)
Title: Add primitives and configuration for async execution of blocking I/O

- AsyncExecutor manages a pooled ExecutorService and provides an
ExecutionContext for it. It is optimized for blocking I/O calls.

- The Database factory methods for JdbcBackend take an additional
AsyncExecutor argument, falling back to an executor with a default
configuration.

- Database.forConfig allows the executor parameters to be configured
through config keys, automatically using the correct thread pool size
for a connection pool.

- DatabaseComponent provides asynchronous execution for all profile
levels. Implementors are required to supply an ExecutionContext
suitable for I/O on a particular Database. DistributedBackend and
HeapBackend use the global ExecutionContext.

- DatabaseComponent provides a close() method for all profile levels.

- TestKit and DBTest close all Database instances properly to ensure
that the thread pools for async tests are shut down.

Test for async execution primitives in ExecutorTest.testAsyncExecution.

/cc @viktorklang @jboner