tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: HTTP/2 PushBuilder.push() synchronous?
Date Thu, 29 Sep 2016 16:16:49 GMT
On 29 September 2016 15:30:40 BST, Brian Clozel <> wrote:
>Looking at previous Servlet 4.0 EG e-mails [1] and the
>API [2], it seems the current version returns true if the PUSH_PROMISE
>frame + headers were sent, meaning the client can still reset that
>and refuse to receive the response that goes with it.

Not quite. It returns true if the push is accepted by the server. I'm on my phone so looking
at the code is tricky. I can't remember if an error triggers an exception or returns false.

>Now looking at former EG e-mails, it seems that a previous version of
>spec stated that push "returns immediately without blocking" [3]. But
>API, and the implementation as far as I understand things [4], seems
>synchronous. Or does that writing does not happen directly on the
>socket but is later dispatched on another thread?

The push is built on the current thread and then passed to a separate thread for processing.
The idea being to catch as many errors as possible on the current thread.

The client is free to reset the pushed steam at any point. 



>In general, I'm trying to understand how I can use that API in an
>non-blocking way and if the application really needs to know if the
>promise "happened" or not...
>Brian Clozel

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message