Making data streaming possible by moving the response future... #5116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
... and callback completion right after headers are received.
All necessary information is present to ensure proper Jersey handling of the content.
Jetty client is perfectly able to stream data on-the-fly. But current Connector implementation awaits completion.
I've tested with ApacheConnector; it streams data correctly.
Unfortunately, the callback change generates an unwanted deadlock when reading an entity through a MessageBodyReader in org.glassfish.jersey.client.JerseyInvocation#translate.
The entity reading seems to be triggered by calling the response callback.
The Jetty thread does the call when using async(), but since it is also the one pushing contents to the buffer, the result is a deadlock.