Terminus v0.0.1 Terminus.Request View Source
A GenStage
producer module for creating streaming HTTP requests.
Each request is a GenStage process, enabling creating powerful concurrent data flows.
Usage
# Create the connection process
iex> Terminus.Request.connect(:https, host, 443)
{:ok, pid}
# Begin a request
iex> Terminus.Request.request(pid, "GET", path, headers, body)
:ok
# Stream the result
iex> GenStage.stream([{pid, cancel: :transient}])
%Stream{}
Link to this section Summary
Link to this section Types
Streaming HTTP request state
Link to this section Functions
Creates a new connection to a given server and returns a GenStage pid
.
Sends a request to the connected server.
The function is asynchronous and returns :ok
. The GenStage pid
can be subscribed to to listen to streaming data chunks.