Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Fwd: Jetty Client 9.04 threads

Hi,

On Thu, Jul 18, 2013 at 8:40 PM, Kamil Gorlo <kgorlo@xxxxxxxxx> wrote:
> Thanks!
>
> So, in your opinion task like parsing HTML (I've implemented something
> similar to webcrawler) or calling external services (i've implemented
> own redirect logic to check that host in Location header is "safe" -
> i.e does not redirect to my internal network - so I am calling DNS
> resolver in callback), should have own thread pool?

Not really.
Parsing HTML from HttpClient callbacks is usually fast and
non-blocking, so I'd do it without spawning.
Redirect logic that access the network, on the other end, can block,
so I would spawn for that.
But really, you should measure, because spawning does have a performance cost.

> HttpClient threads are only for tasks like parsing HTTP requests and
> other "framework" tasks?

No, they can be used for application tasks, provided they don't block.
Don't do JDBC calls from them, but pretty much every in-memory
operation I'd do it without spawning.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top