grpc
grpc copied to clipboard
Feature request: recv streaming response asynchronously via message passing
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 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
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.