Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jersey-dev] Writing resposne without blocking thread

Can't it be like in Netty, that you the actual write to the socket doesn't block any thread regardless in pool or not? (NIO)


On Sun, May 14, 2023 at 4:44 PM Markus Karg <markus@xxxxxxxxxxxxxxx> wrote:

If your resource returns CompletionStage<T> by e. g. return CompletableFuture.supplyAsync(() -> …your code…, POOL) then you even can use your own thread pool to prevent blocking of the I/O calls. Not that this is not necessary when running in application servers, as they already provide customizable pool size for that purpose. For example, in Payara you simply can have separate pool sizes for TCP and http, so it is irrelevant that Jersey is running in the http pool by default.

-Markus

 

 

Von  jersey-dev [mailto:jersey-dev-bounces@xxxxxxxxxxx] Im Auftrag von Asaf Mesika
Gesendet: Sonntag, 14. Mai 2023 15:26
An: jersey-dev@xxxxxxxxxxx
Betreff: [jersey-dev] Writing resposne without blocking thread

 

Hi,

 

I was wondering if Jersey supports an implementation of AsyncResponse.resume() in which when it takes a thread from the pool, it doesn't block it for the I/O calls - i.e. like Jetty or Jetty supports writing an object without blocking a thread for the I/O itself.

 

Thanks,

 

Asaf

 

_______________________________________________
jersey-dev mailing list
jersey-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jersey-dev

Back to the top