Bandit.HTTP2.StreamCollection (Bandit v0.3.8) View Source

Represents a collection of HTTP/2 streams, accessible by stream id or pid. Provides the ability to track streams with any identifier, even though it only manages explicit state for existing (current) streams.

Link to this section Summary

Types

t()

A collection of Stream structs, accessisble by id or pid

Link to this section Types

Specs

t() :: %Bandit.HTTP2.StreamCollection{
  initial_recv_window_size: non_neg_integer(),
  initial_send_window_size: non_neg_integer(),
  last_local_stream_id: Bandit.HTTP2.Stream.stream_id(),
  last_remote_stream_id: Bandit.HTTP2.Stream.stream_id(),
  max_concurrent_streams: non_neg_integer() | :infinity,
  streams: %{
    required(Bandit.HTTP2.Stream.stream_id()) => Bandit.HTTP2.Stream.t()
  }
}

A collection of Stream structs, accessisble by id or pid

Link to this section Functions

Link to this function

can_send_new_push_promise(collection)

View Source

Specs

can_send_new_push_promise(t()) :: :ok | {:error, :max_concurrent_streams}
Link to this function

get_active_stream_by_pid(collection, pid)

View Source

Specs

get_active_stream_by_pid(t(), pid()) ::
  {:ok, Bandit.HTTP2.Stream.t()} | {:error, :no_stream}
Link to this function

get_stream(collection, stream_id)

View Source

Specs

Link to this function

last_remote_stream_id(collection)

View Source

Specs

last_remote_stream_id(t()) :: Bandit.HTTP2.Stream.stream_id()
Link to this function

next_local_stream_id(collection)

View Source

Specs

next_local_stream_id(t()) :: Bandit.HTTP2.Stream.stream_id()
Link to this function

put_stream(collection, stream)

View Source

Specs

put_stream(t(), Bandit.HTTP2.Stream.t()) ::
  {:ok, t()} | {:error, :invalid_stream}
Link to this function

update_initial_send_window_size(collection, initial_send_window_size)

View Source

Specs

update_initial_send_window_size(t(), non_neg_integer()) :: t()
Link to this function

update_max_concurrent_streams(collection, max_concurrent_streams)

View Source

Specs

update_max_concurrent_streams(t(), non_neg_integer()) :: t()