Tinkex.Types.TryAgainResponse (Tinkex v0.3.4)

View Source

Response indicating queue backpressure - the client should retry polling.

Mirrors the Python TryAgainResponse schema and normalizes queue state into atoms via Tinkex.Types.QueueState.

Summary

Functions

Build a %TryAgainResponse{} map decoded from JSON.

Types

t()

@type t() :: %Tinkex.Types.TryAgainResponse{
  queue_state: Tinkex.Types.QueueState.t(),
  queue_state_reason: String.t() | nil,
  request_id: String.t(),
  retry_after_ms: non_neg_integer() | nil,
  type: String.t()
}

Functions

from_map(map)

@spec from_map(map()) :: t()

Build a %TryAgainResponse{} map decoded from JSON.

Expects a map (string or atom keys) containing the "type", "request_id", and "queue_state" fields. Raises ArgumentError when data is malformed or missing required keys to keep the union invariant for callers like FutureRetrieveResponse.from_json/1.