Chat-level overlapping-message concurrency configuration.
The model is a pure state protocol. It does not start timers or processes.
Callers supply now_ms when they need deterministic timing and call
Jido.Chat.drain_lock/4 after the configured idle window.
Queue and burst entries default to a size of 10 and a lifetime of 90 seconds.
Burst and debounce idle windows default to 1.5 seconds. Concurrent handlers
are unbounded unless max_concurrent is set.
Summary
Functions
Returns the lock key for the configured thread or channel scope.
Returns a deterministic message context for drained pending entries.
Creates a normalized concurrency config.
Returns the schema for concurrency configuration.
Types
@type lock_scope() :: :thread | :channel
@type overflow_policy() :: :drop_oldest | :drop_newest
@type pending_entry() :: %{ owner: String.t(), strategy: strategy(), metadata: map(), enqueued_at: non_neg_integer(), expires_at: pos_integer(), ready_at: non_neg_integer(), conversation_key: String.t() }
@type strategy() :: :reject | :queue | :debounce | :burst | :concurrent
@type t() :: %Jido.Chat.Concurrency{ debounce_ms: integer(), lock_scope: :thread | :channel, max_concurrent: nil | nil | integer(), max_queue_size: integer(), metadata: map(), overflow_policy: :drop_oldest | :drop_newest, queue_entry_ttl_ms: integer(), strategy: :reject | :queue | :debounce | :burst | :concurrent }
Functions
Returns the lock key for the configured thread or channel scope.
@spec message_context([map()]) :: Jido.Chat.MessageContext.t()
Returns a deterministic message context for drained pending entries.
Creates a normalized concurrency config.
Returns the schema for concurrency configuration.