j.u.c.ExecutorService and async-http-client

223 views
Skip to first unread message

Antony Stubbs

unread,
Apr 19, 2012, 10:58:35 AM4/19/12
to akka...@googlegroups.com
I need async http, and I think it really needs to be driven by Akka's thread pool management.

Looking at this thread:

and the async-http-client and spray-can-client.

I'm in a Java centric environment, which mostly rules out spray-can, but I want akka integrated thread pool for async http calls.

Please correct me if I'm wrong, but async-http-client uses and j.u.c.ExecutorService, but Akka doesn't provide that interface, so it can't natively run j.u.c.ExecutorService jobs for other libraries. That thread above mentioned a bridge, but from what I understand, it talked about taking async-http-client's j.u.c. ExecutorService and providing it to an Akka system for use. To me I thought it would make more sense to have async-http-client use Akka's thread managed pool.

So, I can implement j.u.c.ExecutorService, and have it delegate to ActorSystem#dispatcher()#execute(); Is it really as straight forward as that?

√iktor Ҡlang

unread,
Apr 19, 2012, 11:07:13 AM4/19/12
to akka...@googlegroups.com
Depends. Is async-http-client trying to shut the service down? If it is, then you'll have to create a wrapper that ignores shutdown. MessageDispatcher implements Executor, so you'll just need to wrap that as an ExecutorService (taking into consideration what I mention previously)

Cheers,

 

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To view this discussion on the web visit https://groups.google.com/d/msg/akka-user/-/bHmz39z-PvwJ.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.



--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Derek Williams

unread,
Apr 19, 2012, 11:07:55 AM4/19/12
to akka...@googlegroups.com
If it helps, Akka's dispatcher implements Executor, so it's at least part way to ExecutorService. Implementing an ExecutorService that delegates to 'execute' should be all you need.

--
Derek Williams

Antony Stubbs

unread,
Jun 21, 2012, 3:55:11 PM6/21/12
to akka...@googlegroups.com
Just for reference sake, we are instead looking at using akka-camel with an http producer to make the asynchronous http call :)
Reply all
Reply to author
Forward
0 new messages