You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found out that it's not possible to stream an http/2 request while streaming the response. Besides the http/2 protocol supports it in theory (and some clients/servers also does in other languages).
Context unrelated to the issue
I'm writting a GRPC Client. GRPC uses HTTP/2 to its full potential. For example, for bi-directional streaming, it allows the client to stream messages by writing the request while the server may also respond with many messages streamed in the response.
Here is a schema explaining how it works (I hope it makes things clear):
Hello
I found out that it's not possible to stream an http/2 request while streaming the response. Besides the http/2 protocol supports it in theory (and some clients/servers also does in other languages).
Context unrelated to the issue
I'm writting a GRPC Client. GRPC uses HTTP/2 to its full potential. For example, for bi-directional streaming, it allows the client to stream messages by writing the request while the server may also respond with many messages streamed in the response.
Here is a schema explaining how it works (I hope it makes things clear):
This is why I have this code - simplified here for issue purpose (click to open):
The actual issue
Basically, I cannot "write" after the streaming of the response started because the request phase is "ResponseBody".
The error is the following (click me)
Fix hints
The response needs to be writable while the request body is not finished yet
I have no definitive fix for now. But I started investigating the issue. It seems that this line may be change:
http-client/src/Internal/EventInvoker.php
Line 162 in a3e8711
For this:
Not sure what are the downsides at this point.
Hum. I figured out that the body of the response is never filled besides the server started to answer. It seems to be another problem :/ .
The request body needs to be streamable
I think the following code is blocking the streaming of the request:
http-client/src/Connection/Internal/Http2ConnectionProcessor.php
Line 997 in a3e8711
Here is a test that may be interesting (it's WIP)
In Http2ConnectionTest:
The text was updated successfully, but these errors were encountered: