Bandit.HTTP2.Stream (Bandit v0.3.8) View Source
Carries out state management transitions per RFC7540§5.1. Anything having to do with the internal state of a stream is handled in this module. Note that sending of frames on behalf of a stream is a bit of a split responsibility: the stream itself may update state depending on the value of the end_stream flag (this is a stream concern and thus handled here), but the sending of the data over the wire is a connection concern as it must be serialized properly & is subject to flow control at a connection level
Link to this section Summary
Types
A description of a stream error
An HTTP/2 stream state
An HTTP/2 stream identifier
A single HTTP/2 stream
Link to this section Types
Specs
error() :: {:stream, stream_id(), Bandit.HTTP2.Errors.error_code(), String.t()}
A description of a stream error
Specs
state() :: :reserved_local | :idle | :open | :local_closed | :remote_closed | :closed
An HTTP/2 stream state
Specs
stream_id() :: non_neg_integer()
An HTTP/2 stream identifier
Specs
t() :: %Bandit.HTTP2.Stream{ pending_content_length: non_neg_integer() | nil, pid: pid() | nil, recv_window_size: non_neg_integer(), send_window_size: non_neg_integer(), state: state(), stream_id: stream_id() }
A single HTTP/2 stream
Link to this section Functions
Specs
get_send_window_size(t()) :: non_neg_integer()
Specs
Specs
recv_data(t(), binary()) :: {:ok, t(), non_neg_integer()} | {:error, Bandit.HTTP2.Connection.error()}
Specs
recv_end_of_stream(t(), boolean()) :: {:ok, t()} | {:error, Bandit.HTTP2.Connection.error()}
Specs
recv_headers( t(), Plug.Conn.headers(), boolean(), Plug.Conn.Adapter.peer_data(), Bandit.plug() ) :: {:ok, t()} | {:error, Bandit.HTTP2.Connection.error()} | {:error, error()}
Specs
recv_rst_stream(t(), Bandit.HTTP2.Errors.error_code()) :: {:ok, t()} | {:error, Bandit.HTTP2.Connection.error()}
Specs
recv_window_update(t(), non_neg_integer()) :: {:ok, t()} | {:error, Bandit.HTTP2.Connection.error()} | {:error, error()}
Specs
send_data(t(), non_neg_integer()) :: {:ok, t()} | {:error, :insufficient_window_size} | {:error, :invalid_state}
Specs
Specs
Specs
send_push_headers(t(), Plug.Conn.headers()) :: {:ok, t()} | {:error, error()}
Specs
start_push( t(), Plug.Conn.headers(), Plug.Conn.Adapter.peer_data(), Bandit.plug() ) :: {:ok, t()}
Specs
stream_terminated(t(), term()) :: {:ok, t(), Bandit.HTTP2.Errors.error_code() | nil}