View Source K8s.Client.Mint.Request (k8s v2.0.0-rc.6)
Maintains the state of a HTTP or Websocket request.
Link to this section Summary
Link to this section Types
@type request_modes() :: :receiving | :closing | :terminating | :closed
Describes the mode the request is currently in.
: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:closed
- The websocket request is closed. The process is going to terminate any moment now
@type t() :: %K8s.Client.Mint.Request{ buffer: list(), caller_ref: reference(), mode: request_modes(), pool: pid() | nil, stream_to: pid() | {pid(), reference()} | nil, websocket: Mint.WebSocket.t() | nil }
Defines the state of the request.
:caller_ref
- ,onitor 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
Link to this section 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() | :stop, t()}