grpc icon indicating copy to clipboard operation
grpc copied to clipboard

Feature request: recv streaming response asynchronously via message passing

Open qinix opened this issue 6 years ago • 2 comments

Message passing is more Elixir way than blocking Stream, especially for streaming response.

As an example, HTTPoison supports async requests in this way:

iex> HTTPoison.get! "https://github.com/", %{}, stream_to: self
%HTTPoison.AsyncResponse{id: #Reference<0.0.0.1654>}
iex> flush
%HTTPoison.AsyncStatus{code: 200, id: #Reference<0.0.0.1654>}
%HTTPoison.AsyncHeaders{headers: %{"Connection" => "keep-alive", ...}, id: #Reference<0.0.0.1654>}
%HTTPoison.AsyncChunk{chunk: "<!DOCTYPE html>...", id: #Reference<0.0.0.1654>}
%HTTPoison.AsyncEnd{id: #Reference<0.0.0.1654>}
:ok

qinix avatar Mar 06 '18 10:03 qinix

@qinix do you recall to which part of the code this issue pertains? I'd like to improve upon that, but I'm not sure which part of the code you're talking about here

polvalente avatar Jul 19 '22 15:07 polvalente

My guess is that this is related to what I'm running into -- I have a GRPC Stub from which I need to receive a stream, but the HTTP request hangs indefinitely until there's something that can be streamed -- which blocks everything.

feld avatar Nov 20 '23 21:11 feld