View Source K8s.Client.Mint.Request (k8s v2.4.2)
Maintains the state of a HTTP or Websocket request.
Summary
Types
@type request_modes() :: :pending | :receiving | :closing | :terminating
Describes the mode the request is currently in.
::pending
- The request is still streaming its body to the server:receiving
- The request is currently receiving response parts / frames:closing
- Websocket requests only: The:close
frame was received but the process wasn't terminated yet:terminating
- HTTP requests only: The:done
part was received but the request isn't cleaned up yet
@type t() :: %K8s.Client.Mint.Request{ buffer: list(), caller_ref: reference(), mode: request_modes(), pending_request_body: binary(), pool: pid() | nil, request_ref: Mint.Types.request_ref(), stream_to: pid() | {pid(), reference()} | nil, websocket: Mint.WebSocket.t() | nil }
Defines the state of the request.
:request_ref
- Mint request reference:caller_ref
- Monitor reference of the calling process.:stream_to
- the process expecting response parts sent to.:pool
- the PID of the pool so we can checkin after the last part is sent.:websocket
- for WebSocket requests: The websocket state (Mint.WebSocket.t()
).:mode
- defines what mode the request is currently in.:buffer
- Holds the buffered response parts or frames that haven't been sent to / received by the caller yet:pending_request_body
- Part of the request body that has not been sent yet.
Functions
@spec receive_upgrade_response(Mint.HTTP.t(), reference()) :: {:ok, Mint.HTTP.t(), map()} | {:error, Mint.HTTP.t(), Mint.Types.error()}
@spec recv(t(), GenServer.from()) :: :pop | {t(), t()}
@spec stream_request_body(t(), Mint.HTTP.t()) :: {:ok, t(), Mint.HTTP.t()} | {:error, Mint.HTTP.t(), Mint.Types.error()}