Bandit.HTTP2.StreamCollection (Bandit v0.3.4) 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{
  last_local_stream_id: Bandit.HTTP2.Stream.stream_id(),
  last_remote_stream_id: Bandit.HTTP2.Stream.stream_id(),
  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

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

put_stream(collection, stream)

View Source

Specs

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