Jersey is bound to the JAX-RS specification. If you want to decouple the http thread from the application thread then you have only two choices: Async and CompletableFuture. There is no free lunch. -Markus Von: jersey-dev [mailto:jersey-dev-bounces@xxxxxxxxxxx] Im Auftrag von Asaf Mesika Gesendet: Sonntag, 14. Mai 2023 17:59 An: jersey developer discussions Betreff: 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) 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 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. _______________________________________________ jersey-dev mailing list jersey-dev@xxxxxxxxxxx To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jersey-dev
|