Hey √iktor, by mistake I forgot to do a reply all, so I sent the
message quoted below only to you, now forwarded to scala-user too.
Sorry.
I came up with the following implementation for an ExecutorService
that wraps an ExecutionContext, don't know if this is correct but I
think I'll end up using something like this:
https://gist.github.com/alexandru/5244811
On Tue, Mar 26, 2013 at 1:04 PM, Alexandru Nedelcu <
m...@alexn.org> wrote:
> Hi Viktor, thanks for the answer.
>
> I have a web service that I need to keep lean and mean and letting
> Java libraries manage their own thread-pools is kind of a pain point.
> Many Java APIs do allow you to specify an executor service as an
> alternative to using their default and since (when working with
> Futures/Promises/Akka) I already have a default thread-pool, it would
> be nice to use it for these Java libraries too.
>
> The latest thing I want to try out is to use an
> AsynchronousFileChannel, as writing to the same file from multiple
> threads can become a real bottleneck. If you don't specify an executor
> for AsynchronousFileChannel, then it will use the default, whatever
> that is.
>
> When it comes to these Java libraries, if you specify an executor,
> they don't shut it down by themselves, as they only need the ability
> to submit tasks, so I guess I can simply throw
> UnsupportedOperationException or something on shutdown(),
> shutdownNow() and on awaitTermination().
Alexandru Nedelcu
http://bionicspirit.com