Ankh.HTTP2.Stream (ankh v0.14.0)

HTTP/2 stream process

Struct implementing the HTTP/2 stream state machine

Link to this section Summary

Types

Stream HBF type

Stream id

Stream states

t()

Stream

Functions

Tests if a stream is client originated

Tests if a stream id is locally originated

Tests if a stream is client originated

Starts a new stream fot the provided connection

Process a received frame for the stream

Process and send a frame on the stream

Link to this section Types

Link to this type

end_stream()

Specs

end_stream() :: boolean()

Specs

hbf_type() :: :headers | :push_promise | nil

Stream HBF type

Specs

id() :: non_neg_integer()

Stream id

Specs

state() ::
  :idle
  | :open
  | :closed
  | :half_closed_local
  | :half_closed_remote
  | :reserved_remote
  | :reserved_local

Stream states

Specs

t() :: %Ankh.HTTP2.Stream{
  id: id(),
  recv_end_stream: boolean(),
  recv_hbf: iodata(),
  recv_hbf_type: hbf_type(),
  recv_headers: boolean(),
  reference: reference(),
  send_hbf_type: hbf_type(),
  state: state(),
  window_size: window_size()
}

Stream

Link to this type

window_size()

Specs

window_size() :: integer()

Link to this section Functions

Link to this function

adjust_window_size(stream, old_window_size, new_window_size)

Specs

adjust_window_size(t(), window_size(), window_size()) :: t()

Adjusts the stream window size

Link to this macro

is_client_stream(stream_id)

(macro)

Tests if a stream is client originated

Link to this macro

is_local_stream(last_local_stream_id, stream_id)

(macro)

Tests if a stream id is locally originated

Link to this macro

is_server_stream(stream_id)

(macro)

Tests if a stream is client originated

Link to this function

new(id, window_size)

Specs

new(id(), window_size()) :: t()

Starts a new stream fot the provided connection

Link to this function

recv(stream, frame)

Specs

recv(t(), Ankh.HTTP2.Frame.t()) ::
  {:ok, t(), Ankh.HTTP.response() | nil} | {:error, any()}

Process a received frame for the stream

Link to this function

send(stream, frame)

Specs

send(t(), Ankh.HTTP2.Frame.t()) :: {:ok, t()} | {:error, any()}

Process and send a frame on the stream