HTTPStream.Adapter behaviour (HTTPStream v1.0.0) View Source

Adapter behaviour for HTTPStream compatible clients.

An adapter must implement the following callbacks:

  • request/1 - Receives an HTTPStream.Request.t() and initiates the HTTP connection to the endpoint.
  • parse_chunks/1 - Receives values of any type returned by request/1 and reads a chunk of data from the connection.
  • close/1 - Called when the final value from parse_chunks/1 is read. Should close the connection.

Currently supported adapters: HTTPStream.Adapter.Mint

Link to this section Summary

Link to this section Callbacks

Specs

close(any()) :: :ok | {:error, term()}

Specs

parse_chunks(any()) :: any()

Specs

request(HTTPStream.Request.t()) :: any()