#[non_exhaustive]pub struct HandlerLimits {Show 34 fields
pub max_id_length: usize,
pub max_metadata_size: usize,
pub max_cancellation_tokens: usize,
pub max_token_age: Duration,
pub push_delivery_timeout: Duration,
pub push_delivery_budget: Duration,
pub push_queue_capacity: usize,
pub push_suspend_after: usize,
pub push_suspend_for: Duration,
pub push_remove_gone: bool,
pub push_max_in_flight: usize,
pub push_max_in_flight_per_host: usize,
pub push_max_in_flight_per_partition: usize,
pub push_outbox_max_age: Duration,
pub push_outbox_backoff_max: Duration,
pub executor_drain_timeout: Duration,
pub max_artifacts_per_task: usize,
pub max_context_locks: usize,
pub max_push_configs_per_task: usize,
pub max_parts_per_artifact: usize,
pub max_total_push_configs: usize,
pub subscribe_reattach_interval: Duration,
pub subscribe_reattach_max_interval: Duration,
pub subscribe_max_idle: Option<Duration>,
pub max_subscribers_per_task: usize,
pub max_subscribers: usize,
pub hand_off_window: Duration,
pub subscribe_replay_limit: usize,
pub subscribe_replay_catchup: Duration,
pub final_task_snapshot: bool,
pub store_write_retry: Duration,
pub terminal_confirmation: TerminalConfirmation,
pub max_buffered_event_bytes: Option<usize>,
pub saturation_readiness: Option<(u8, u8)>,
}Expand description
Configurable limits for the request handler.
All fields have sensible defaults. Create with HandlerLimits::default()
and override individual values as needed.
§Example
use a2a_protocol_server::handler::HandlerLimits;
let limits = HandlerLimits::default()
.with_max_id_length(2048)
.with_max_metadata_size(2 * 1024 * 1024);#[non_exhaustive]: build it with Default and the with_* setters,
which cover every field; a struct literal is not available outside this
crate, so a field added later does not break callers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_id_length: usizeMaximum allowed length for task/context IDs. Default: 1024.
message.id is bounded too, but never below
MIN_MESSAGE_ID_LENGTH — see
effective_max_message_id_length
for why it cannot simply share this number.
max_metadata_size: usizeMaximum allowed serialized size for metadata fields in bytes. Default: 1 MiB.
max_cancellation_tokens: usizeMaximum cancellation token map entries before cleanup sweep. Default: 10,000.
A sweep threshold, not a hard bound: the sweep only evicts cancelled or aged-out entries whose executor is gone — a token belonging to a live task is never removed, so with more than this many tasks genuinely in flight the map tracks the in-flight count instead.
max_token_age: DurationMaximum age for cancellation tokens. Default: 1 hour.
push_delivery_timeout: DurationTimeout for individual push webhook deliveries. Default: 30 seconds.
Bounds how long the handler waits for a single push notification delivery to complete, preventing one slow webhook from blocking all subsequent deliveries.
§This is a total, and the sender’s retries have to fit inside it
The bound covers the whole PushSender::send call, retries included —
not one HTTP request. A sender whose own schedule is longer never
finishes it, and the attempts it advertises simply do not happen.
At the shipped defaults every attempt starts. HttpPushSender::new()
is three attempts at a 10-second request timeout with [1s, 2s]
backoff after a 5-second DNS bound — 38 seconds at worst — against
this 30-second bound. When every request runs to its timeout the
attempts start at 5s, 16s and 28s: the first two finish and the third
has 2 seconds. Both numbers sit in the 10-30 seconds spec §4.3.3 and
§13.2 recommend for webhook requests.
Until 2026-10-12 the defaults were 30-second requests against a 5-second bound, and one attempt in three reached the webhook (measured 2026-08-19 against a real socket; the bound fired at 5.001s).
A bound as long as push_delivery_budget
means one timeout fills the budget, so an event’s deliveries all run at
once (see the budget’s concurrency rule). That is concurrency, not
extra work: every config was always attempted, and the event still
finishes inside the budget. To keep fewer in flight, raise the budget
or lower this bound. The arithmetic, for any pair of settings:
attempts_that_run == 1 + how many whole (request_timeout + backoff)
cycles fit in push_delivery_timeoutA sender that reports PushSender::max_delivery_duration gets the
truncation counted rather than mistaken for a slow endpoint — see
push_outcome::TIMEOUT_TRUNCATED.
push_delivery_budget: DurationTotal time one event’s push deliveries may take, across every registered config. Default: 30 seconds.
Every configured webhook is attempted (spec §4.3.3: at least one
attempt each); the budget decides how many deliveries of one event run
at once, the fewest that fit every attempt into it:
ceil(configs / (budget / push_delivery_timeout)), at least one and at
most configs. At the defaults (30s, 30s) one timeout fills the budget,
so all of an event’s deliveries run at once, up to
max_push_configs_per_task; before 2026-10-12 (5s, 30s) it was 17 of
100 at a time. When not even one timeout fits, all of an event’s
deliveries run at once and the event takes one timeout, past the budget.
max_push_configs_per_task caps how many there can be. On the blocking
send path the budget covers the whole batch of events a request
produced, delivered in order.
Until 2026-10-11 deliveries ran one after another and the budget decided which webhooks were reached: at the defaults a slow estate reached 6 of 100 per event and skipped the rest.
push_queue_capacity: usizeHow many deliveries may wait behind the one under way for one task. Default: 1,024.
Each task’s push notifications go through one lane, in order, on a
task of their own: the event is stored, handed to the lane, and the
next event is stored without waiting for any webhook. A blocking
send’s events go into the same lane as one delivery, so a webhook
sees every turn of a task in the order it happened, whichever send
path ran it. Until 2026-10-30 the streaming path delivered inline,
so a webhook that did not answer held the task’s next event out of
the store for up to push_delivery_timeout
each, and held the turn’s claim with it, so a continuation sent to
another replica was refused (audit D-02, E-F3).
When a lane is full, the oldest waiting delivery that does not end a
turn is dropped and counted as
push_outcome::DROPPED:
a webhook that cannot keep up loses intermediate events (artifact
chunks, working), never the terminal or interrupted status that
ends a turn. Spec §4.3.3 lets an agent stop attempting delivery after
a configured number of failures; this is that number, counted in
waiting deliveries rather than failures, since a lane only fills
behind a webhook that is slower than the agent. Zero is read as one.
push_suspend_after: usizeHow many deliveries to a webhook may fail in a row before it is suspended. Default: 5. Zero turns suspension off.
Each failed delivery has already had the sender’s retries (three
attempts, up to 38 s at the defaults), so five is five events a
webhook did not take. A suspended webhook is not sent the events that
follow, for push_suspend_for, then one
event is tried again: a success ends the suspension, a failure
doubles the next (up to 32 times as long). The events that end a turn
(a terminal or interrupted status) are always attempted, so a webhook
that comes back is told how a task ended. The config is kept, and
each skipped delivery is counted as
push_outcome::SUSPENDED.
Spec §4.3.3 allows an agent to stop attempting delivery after a
configured number of consecutive failures (audit D-05). The count is
per replica and held in memory, as delivery is.
push_suspend_for: DurationHow long a suspended webhook is left alone before one event is
tried again. Default: 30 s; see
push_suspend_after.
push_remove_gone: boolWhether a webhook that answers 410 Gone has its config removed.
Default: true.
410 is the receiver saying the address is permanently gone, so the
config would only be tried, and answered 410, on every later event.
Removing it is the store’s delete: the client sees it as the config
no longer listed. Only 410: a 404 can be a deploy in progress and
counts as any other failure. A sender other than HttpPushSender
reports a status in its error’s data as {"httpStatus": 410} to
get the same.
push_max_in_flight: usizeThe most webhook deliveries in flight at once, across every task. Default: 512. Zero is read as one.
max_push_configs_per_task and the
per-event concurrency bound one event’s fan-out, and a task’s lane
serialises its own events, but until 2026-10-31 nothing bounded how
many tasks delivered at once: N tasks of 100 configs each opened up to
100 x N outbound connections, for a caller who needs no credentials
where the agent is anonymous (audit N-SEC-6). A delivery beyond the
bound waits for one to finish, so every config is still attempted
(spec section 4.3.3). The wait is bounded by
push_delivery_timeout but does not
spend it: the webhook’s time starts when the delivery is let through,
and one that is never let through ends as
push_outcome::THROTTLED
without a request (until 0.16.0 the wait counted against the timeout,
so a full gate showed as timeout outcomes; audit NEW-f-2). Each
delivery that waited is reported once to
Metrics::on_error as
("PushDelivery", "push_throttled").
The bound covers every sender behind a handler, a custom one included; a sender used outside a handler is not bounded. 512 is a choice, not a measurement: about five times one task’s full fan-out. Keep it well under the process’s file-descriptor limit.
push_max_in_flight_per_host: usizeThe most deliveries in flight at once to one destination, host and port. Default: 64. Zero is read as one.
One caller can register up to
max_push_configs_per_task
webhooks on a task, all at a third party’s address, and every event
goes to all of them (audit SEC-14). This bounds how many requests that
third party sees at once from this agent; it is not a rate limit. The
triage suggested 5 in flight and 20 a second; this takes the first
half at a higher number, because one orchestrator that receives the
callbacks of every agent behind it is a legitimate single destination
with a great many deliveries. A receiver that needs more raises it.
Names that mean the same destination (case, a trailing dot, an
address written in decimal or hex) share one count. The same bound
applies to each address the bundled sender connects to, once the name
is resolved, port aside: names that resolve to one address (a
wildcard record pointing at a victim) share that address’s count
(audit NEW-d-3). A delivery beyond the bound waits, as for
push_max_in_flight.
push_max_in_flight_per_partition: usizeThe most deliveries in flight at once for one store partition: a
tenant, or a tenant and caller where callers are isolated
(TenantContext::partition).
Default: 256, half of push_max_in_flight.
Zero is read as one.
Without it one caller with slow webhooks (64 per destination, so eight
ports on one tarpit) held all 512 overall permits, and every other
tenant’s deliveries waited behind it (audit NEW-f-2). With it, one
partition leaves at least the other half to the rest. Callers that are
not told apart (one tenant, callers not isolated) are one partition:
a deployment with one partition runs at most this many at once, so
raise it with push_max_in_flight there.
push_outbox_max_age: DurationHow long the push outbox keeps trying a delivery (ADR 0037): a row
older than this when it is next due is dropped and counted as
push_outcome::EXPIRED.
Default: 24 hours. Only with
with_push_outbox.
A choice, not a measurement: long enough for a receiver that is down overnight, short enough that a webhook gone for good does not keep its rows for a week.
push_outbox_backoff_max: DurationThe longest the push outbox waits between two attempts of one delivery: the wait doubles from 1 second up to this, less up to a fifth of jitter. Default: 1 hour.
executor_drain_timeout: DurationHow long the blocking send path waits, after the executor has finished, for the event queue to close. Also how long a send that continues a parked task waits for the task’s previous turn to finish. Default: 5 seconds.
Once the executor returns, everything it wrote is already buffered and
is drained immediately; the only thing left to wait for is the
queue closing, which EventQueueManager::destroy does from the cleanup
guard’s Drop. An executor that returns without reaching a terminal
or interrupted state, on a queue that never closes, used to hold the
blocking SendMessage open forever. When this bound elapses the
response is the task as collected so far, exactly what a closed queue
would have produced, and
Metrics::on_error is called with
error_kind = "executor_drain_timeout".
max_artifacts_per_task: usizeMaximum number of artifacts per task. Default: 1000.
Prevents unbounded memory growth and O(n²) serialization cost when executors emit many artifacts. Once the limit is reached, new artifact updates are rejected.
max_context_locks: usizeMaximum number of per-context locks before cleanup. Default: 10,000.
Context locks serialize concurrent SendMessage requests for the same
context_id. Stale entries (where no other reference is held) are
pruned when this limit is reached. Like
max_cancellation_tokens this is a
prune threshold, not a hard bound — entries currently held by
in-flight requests are never pruned.
max_push_configs_per_task: usizeMaximum number of push notification configs per task. Default: 100.
Enforced by the handler on CreateTaskPushNotificationConfig so the cap
applies uniformly across all store backends. Without it, the SQL
stores (which do not self-enforce) let a client mint unbounded configs
for a single task — a disk-exhaustion vector, and a delivery-amplification
vector since every stream event fans out to all of a task’s configs.
Updating an existing config (same id) does not count against the cap.
max_parts_per_artifact: usizeMaximum number of parts a single artifact may accumulate. Default: 10,000.
max_artifacts_per_task bounds the artifact count, but a stream of
TaskArtifactUpdateEvents with append: true grows one artifact’s
parts without bound. Since executors routinely stream model output
derived from attacker-influenced prompts, this bounds the cumulative
per-artifact (and thus per-task) size. Appends that would exceed the cap
are dropped.
max_total_push_configs: usizeGlobal ceiling on the total number of push configs a store may hold (per-tenant for tenant-scoped stores). Default: 100,000.
Complements max_push_configs_per_task: the per-task cap alone lets a
client mint configs for unboundedly many distinct task ids (100 each),
growing a SQL-backed table without limit. Enforced whenever the store
reports a count (see PushConfigStore::count);
stores that do not report one are unaffected.
subscribe_reattach_interval: DurationHow often a SubscribeToTask stream first re-checks whether its task
has finished, once the current turn’s event queue has closed. Default:
250ms.
A task’s queue lives only as long as one executor invocation, so an
agent that parks a task in input_required closes the queue at every
turn boundary. Spec §3.1.6 requires the stream to run until a
terminal state, so it waits here for the next turn rather than
ending. Only an idle stream pays this cost — a live queue delivers
events immediately.
This is the first wait: while nothing changes it doubles each poll up
to subscribe_reattach_max_interval,
and a change (a queue to attach to, events in the log, a terminal
state) ends the wait and the next one starts here again.
subscribe_reattach_max_interval: DurationThe longest wait between two re-checks of an idle SubscribeToTask
stream. Default: 4s. A value below
subscribe_reattach_interval means no
back-off: the stream polls at that interval throughout.
Without it an idle subscriber of a task parked on another replica read the store about eight times a second for as long as its client stayed (audit E-F25), on the pool that also keeps the replica’s claims alive. Backing off costs latency only after a long idle: the first event of the next turn, run on another replica, reaches the subscriber up to this long after it was logged. Raise it to cut idle load further; lower it, or set it equal to the interval, to keep cross-replica latency at the interval.
subscribe_max_idle: Option<Duration>How long a SubscribeToTask stream waits for a parked task to make
progress before ending, if at all. Default: None, no bound.
Spec §3.1.6 says the stream MUST terminate when the task reaches a
terminal state, so by default it ends only there, or when the client
goes. Every binding notices a client that has gone while the stream
is idle: SSE writes a keep-alive every 30 seconds and a failed write
ends it, WebSocket cancels a connection’s requests when its read loop
ends (and WebSocketDispatcher::with_idle_timeout bounds a silent
peer), gRPC stops when the response channel closes, and SLIMRPC aborts
a session’s handlers when the session closes.
Setting a bound trades that conformance for reclaiming subscriptions
whose clients are still connected but have stopped caring: a stream
to a task left in input_required ends after max_idle without a
terminal state, and the client resubscribes (§3.5.2 makes
reconnection an expected flow). Until 0.15.0 the default was 5
minutes.
max_subscribers_per_task: usizeThe most SubscribeToTask streams open on one task (default 256).
One more is refused before any work as Overloaded, which every
binding sends with a retry delay; the count falls as streams end
(audit H5, ADR 0044).
max_subscribers: usizeThe most SubscribeToTask streams open on this handler, over all
tasks (default 10,000), refused the same way. Each one holds a
receiver and, while its task is quiet, reads the store every few
seconds; nothing else bounds how many there are unless the server’s
max_connections is set.
hand_off_window: DurationHow long the reaper leaves a turn a shutdown handed back to its caller
(ADR 0054) before it ends the task failed/transient (default 600 s,
HAND_OFF_WINDOW). Long enough for
a caller to notice the hand-off and send the turn again; past it, a task
nobody continued is the reaper’s.
subscribe_replay_limit: usizeHow many logged events one read of the task’s event log returns at most. Default: 1,000.
A stream reads the log to replay what it missed: a client
reconnecting with Last-Event-ID, a stream that fell behind the
broadcast channel, a subscription that missed part of a turn. The
bound matters because the offset can be client-supplied:
Last-Event-ID: 0 on a long-running task asks for the whole history,
and without a cap that is an unbounded read held in memory at once.
A longer replay is read a page of this size at a time, each page
delivered before the next is read, and the stream goes back to the
live channel only once the last page is in (§3.5.2). Until 0.15.0 the
replay stopped at the limit: a lag past it ended with streamLagged,
and a resume past it skipped, without saying so, the positions between
the replay’s end and the live stream.
subscribe_replay_catchup: DurationHow long a SubscribeToTask waits for the task’s store to catch up with
what has already been broadcast: a resuming one for the event log, and
any one for the task row its first Task is read from. Default: 2
seconds.
Events reach the log through the background processor, so a position can have been broadcast to live subscribers before it has been appended. A resubscribe attaches its broadcast receiver first and reads the log second; without this wait, a position broadcast just before the receiver existed and appended just after the log was read appears in neither, and the subscriber loses it with no gap it could detect.
The wait is bounded because the processor can be slow for reasons that
are not this subscriber’s problem — a registered webhook is delivered
inline, under push_delivery_budget. On expiry the replay is served
with what the log does hold and the shortfall is logged and counted
under the event_log_catchup persistence-error label, rather than
being passed off as a complete history.
Zero disables the wait.
final_task_snapshot: boolWhether a stream sends the task once more, as a final Task
snapshot, after its terminal state and before it closes. Default:
false.
Spec §11.7: an implementation “MAY optionally resend a final Task
snapshot before closing”. The snapshot is read once the store holds
the terminal event, waiting at most
subscribe_replay_catchup for it;
when the store cannot show the finished task by then, no snapshot is
sent rather than an older one. A send stream’s snapshot carries the
history its request asked for, as the stream’s first Task does.
store_write_retry: DurationHow long a turn’s event consumer goes on writing one event to the
task store while the store answers that it is unavailable for now
(A2aError::is_unavailable: a lost connection, a database restarting,
a lock or statement timeout). Default: 30 seconds.
Each write, to the event log or the task, runs again after 50 ms, then twice as long each time up to 1 s, until it succeeds, fails any other way, or this has passed; the events after it wait meanwhile, so the log keeps their order. Until 2026-10-28 one failed write lost its event: logged and counted, absent from the log and the task. An outage longer than this still loses the event it was writing, so set it past the longest failover the database is expected to take. A task’s ending is kept and written again until the store takes it; a spent budget makes the writes behind it try once each (COR-01).
Every write the consumer makes leaves the store as one would when made again (an upsert, a compare-and-set, an append keyed by position), so a write that applied before its answer was lost is not applied twice. A custom store must keep that true of its own writes. Zero writes each once.
While one write is retried, the events behind it fill the queue, and
an executor that emits more than it holds waits for room. That wait
is this long too (at least five seconds), so the executor is slowed
to the store’s pace rather than failed: until 2026-10-28 it gave up
after five seconds, the turn failed, and its Failed status, meeting
the same full queue, was dropped, leaving the task Submitted or
Working for good.
The longest one write can take is this plus one attempt: the deadline
is checked before each wait, not inside an attempt, and an attempt
can itself wait as long as the store lets it (on PostgreSQL, the
pool’s acquire_timeout, 30 s by default, when no connection can be
had; then the statement). With both defaults, about a minute.
terminal_confirmation: TerminalConfirmationWhat a streaming client is told when the store does not confirm a
terminal event: TerminalConfirmation::Required (the default) ends
the stream with an UNAVAILABLE error, so no client hears that a task
finished that the store does not hold as finished;
TerminalConfirmation::BestEffort delivers the event as emitted.
Adversarial review R1, 2026-11-12.
The wait for the store’s answer is the event queue’s write timeout, the
longer of five seconds and store_write_retry.
A write that lands after the stream was told it was unconfirmed is still
recorded in the log and told to the task’s webhooks, so GetTask,
the log and the webhooks agree with each other; only the stream that
gave up waiting does not carry it.
max_buffered_event_bytes: Option<usize>The most bytes of events held in event queues at once, across every
task, or None (the default) for no bound beyond the per-queue count
and the per-event size (audit H13, ADR 0047).
Each event is charged its serialized size from the moment its writer
accepts it until the last holder drops it: the persistence processor
once stored, each subscriber once sent, the broadcast buffer once
every subscriber has read it. A subscriber that stopped reading
therefore keeps its events charged, which is the memory it pins. A
write that finds the budget spent waits for room as long as a write
may wait for a full queue, then fails, and the task fails with it; a
new turn is refused Overloaded (503, retryable) while less than a
tenth of the budget is free. An event larger than the whole budget is
charged all of it.
saturation_readiness: Option<(u8, u8)>Readiness that follows load, as (unready_at, ready_at) in percent of
capacity, or None (the default): readiness then ignores load (audit
H7, ADR 0046).
Utilization is (running + queued) / capacity, the numbers of
RequestHandler::load. /ready
answers 503 "saturated" once it reaches unready_at, and stays so
until it is at or below ready_at; the band between them keeps one
noisy probe from flapping the state. Replicas of a fleet saturate
together, so readiness taken away under load takes capacity away when
it is most needed: prefer the load signal
(RequestHandlerBuilder::with_load_reporting)
for a balancer that can read it. The build refuses ready_at >= unready_at.
Implementations§
Source§impl HandlerLimits
impl HandlerLimits
Sourcepub const fn effective_max_message_id_length(&self) -> usize
pub const fn effective_max_message_id_length(&self) -> usize
The bound message.id is actually held to: never below
MIN_MESSAGE_ID_LENGTH.
§Why this is not just max_id_length
It was, for one release, and that was a defect. context_id and
task_id are commonly short and often chosen by the deployment;
message.id is minted by the client and is conventionally a UUID. A
deployment tightening max_id_length to anything under 36 — which is
a reasonable thing to do for the two ids it was documented to cover —
then rejected every message from a conformant client, including
every one this SDK’s own examples send.
Caught by examples/incident-response’s handler-limits check, which
sets max_id_length to 32 and asserts that an id within the bound is
accepted. It failed on a 36-character UUID, which is exactly the
report an adopter would have filed.
The clamp rather than a separate knob, for the same reason
effective_batch_size floors a zero batch: an operator tightening a
bound should not have to know that one identifier has a protocol-
imposed floor, and a configuration that cannot serve a conformant
client is not one worth honouring exactly.
Spelled as a saturating offset from the floor rather than the
self.max_id_length > MIN_MESSAGE_ID_LENGTH it reads as, for the
reason mutants.toml records for InMemoryTaskStore::evict: >
mutates to >=, and at exactly the floor both arms return the same
number, so the weakened operator is an equivalent mutant that no
test can kill. The arithmetic below has no such form —
saturating_sub is 0 at or below the floor, which lands the sum on
the floor, and is the excess above it otherwise. Reported by the
incremental mutation gate on this pull request (shard 1 of run
35523981742); the fix is the spelling, not the logic.
Sourcepub const fn with_subscribe_reattach_interval(
self,
interval: Duration,
) -> HandlerLimits
pub const fn with_subscribe_reattach_interval( self, interval: Duration, ) -> HandlerLimits
Sets how often an idle SubscribeToTask stream re-checks its task.
Sourcepub const fn with_subscribe_reattach_max_interval(
self,
interval: Duration,
) -> HandlerLimits
pub const fn with_subscribe_reattach_max_interval( self, interval: Duration, ) -> HandlerLimits
Sets the longest wait between two re-checks of an idle SubscribeToTask
stream. See
subscribe_reattach_max_interval.
Sourcepub const fn with_subscribe_max_idle(self, max_idle: Duration) -> HandlerLimits
pub const fn with_subscribe_max_idle(self, max_idle: Duration) -> HandlerLimits
Sets how long a SubscribeToTask stream waits on a parked task before
ending without a terminal state. See
subscribe_max_idle for what that costs.
Sourcepub const fn with_max_subscribers_per_task(self, max: usize) -> HandlerLimits
pub const fn with_max_subscribers_per_task(self, max: usize) -> HandlerLimits
Sets the most SubscribeToTask streams open on one task; see
max_subscribers_per_task.
Sourcepub const fn with_max_subscribers(self, max: usize) -> HandlerLimits
pub const fn with_max_subscribers(self, max: usize) -> HandlerLimits
Sets the most SubscribeToTask streams open on the handler; see
max_subscribers.
Sourcepub const fn with_hand_off_window(self, window: Duration) -> HandlerLimits
pub const fn with_hand_off_window(self, window: Duration) -> HandlerLimits
Sets how long a handed-back turn waits for its caller; see
hand_off_window.
Sourcepub const fn with_subscribe_replay_limit(self, limit: usize) -> HandlerLimits
pub const fn with_subscribe_replay_limit(self, limit: usize) -> HandlerLimits
Sets how many logged events one read of the event log returns; see
subscribe_replay_limit.
Sourcepub const fn with_subscribe_replay_catchup(
self,
catchup: Duration,
) -> HandlerLimits
pub const fn with_subscribe_replay_catchup( self, catchup: Duration, ) -> HandlerLimits
Sets how long a resuming SubscribeToTask waits for the event log to
catch up with what has already been broadcast. Zero disables the wait.
Sourcepub const fn with_final_task_snapshot(self, on: bool) -> HandlerLimits
pub const fn with_final_task_snapshot(self, on: bool) -> HandlerLimits
Sets whether a stream ends with a final Task snapshot; see
final_task_snapshot.
Sourcepub const fn with_store_write_retry(self, retry: Duration) -> HandlerLimits
pub const fn with_store_write_retry(self, retry: Duration) -> HandlerLimits
Sets how long one event’s store write is retried while the store is
unavailable; see store_write_retry.
Sourcepub const fn with_terminal_confirmation(
self,
confirmation: TerminalConfirmation,
) -> HandlerLimits
pub const fn with_terminal_confirmation( self, confirmation: TerminalConfirmation, ) -> HandlerLimits
Sets what a streaming client is told when the store does not confirm a
terminal event; see terminal_confirmation.
Sourcepub const fn with_max_id_length(self, length: usize) -> HandlerLimits
pub const fn with_max_id_length(self, length: usize) -> HandlerLimits
Sets the maximum allowed length for task/context IDs.
Sourcepub const fn with_max_metadata_size(self, size: usize) -> HandlerLimits
pub const fn with_max_metadata_size(self, size: usize) -> HandlerLimits
Sets the maximum serialized size for metadata fields in bytes.
Sourcepub const fn with_max_cancellation_tokens(self, max: usize) -> HandlerLimits
pub const fn with_max_cancellation_tokens(self, max: usize) -> HandlerLimits
Sets the maximum cancellation token map entries before cleanup.
Sourcepub const fn with_max_token_age(self, age: Duration) -> HandlerLimits
pub const fn with_max_token_age(self, age: Duration) -> HandlerLimits
Sets the maximum age for cancellation tokens.
Sourcepub const fn with_push_delivery_timeout(
self,
timeout: Duration,
) -> HandlerLimits
pub const fn with_push_delivery_timeout( self, timeout: Duration, ) -> HandlerLimits
Sets the timeout for individual push webhook deliveries.
Sourcepub const fn with_push_delivery_budget(self, budget: Duration) -> HandlerLimits
pub const fn with_push_delivery_budget(self, budget: Duration) -> HandlerLimits
Sets the total push-delivery budget per event (per request batch on
the blocking path). See push_delivery_budget.
Sourcepub const fn with_executor_drain_timeout(
self,
timeout: Duration,
) -> HandlerLimits
pub const fn with_executor_drain_timeout( self, timeout: Duration, ) -> HandlerLimits
Sets how long the blocking send path waits for the event queue to
close after the executor finished. See
executor_drain_timeout.
Sourcepub const fn with_max_artifacts_per_task(self, max: usize) -> HandlerLimits
pub const fn with_max_artifacts_per_task(self, max: usize) -> HandlerLimits
Sets the maximum number of artifacts per task.
Sourcepub const fn with_push_queue_capacity(self, capacity: usize) -> HandlerLimits
pub const fn with_push_queue_capacity(self, capacity: usize) -> HandlerLimits
Sets how many push deliveries may wait for one task; see
push_queue_capacity.
Sourcepub const fn with_push_suspend_after(self, failures: usize) -> HandlerLimits
pub const fn with_push_suspend_after(self, failures: usize) -> HandlerLimits
Sets how many failed deliveries in a row suspend a webhook, zero for
never; see push_suspend_after.
Sourcepub const fn with_push_suspend_for(self, pause: Duration) -> HandlerLimits
pub const fn with_push_suspend_for(self, pause: Duration) -> HandlerLimits
Sets how long a suspended webhook is left alone; see
push_suspend_for.
Sourcepub const fn with_push_remove_gone(self, remove: bool) -> HandlerLimits
pub const fn with_push_remove_gone(self, remove: bool) -> HandlerLimits
Sets whether a webhook answering 410 Gone has its config removed;
see push_remove_gone.
Sourcepub const fn with_push_max_in_flight(self, max: usize) -> HandlerLimits
pub const fn with_push_max_in_flight(self, max: usize) -> HandlerLimits
Sets how many webhook deliveries may be in flight across all tasks;
see push_max_in_flight.
Sourcepub const fn with_push_max_in_flight_per_host(self, max: usize) -> HandlerLimits
pub const fn with_push_max_in_flight_per_host(self, max: usize) -> HandlerLimits
Sets how many webhook deliveries may be in flight to one destination;
see push_max_in_flight_per_host.
Sourcepub const fn with_push_max_in_flight_per_partition(
self,
max: usize,
) -> HandlerLimits
pub const fn with_push_max_in_flight_per_partition( self, max: usize, ) -> HandlerLimits
Sets how many webhook deliveries one store partition may have in
flight; see
push_max_in_flight_per_partition.
Sourcepub const fn with_push_outbox_max_age(self, max_age: Duration) -> HandlerLimits
pub const fn with_push_outbox_max_age(self, max_age: Duration) -> HandlerLimits
Sets how long the push outbox keeps trying a delivery; see
push_outbox_max_age.
Sourcepub const fn with_push_outbox_backoff_max(self, max: Duration) -> HandlerLimits
pub const fn with_push_outbox_backoff_max(self, max: Duration) -> HandlerLimits
Sets the longest wait between two attempts of an outbox delivery; see
push_outbox_backoff_max.
Sourcepub const fn with_max_push_configs_per_task(self, max: usize) -> HandlerLimits
pub const fn with_max_push_configs_per_task(self, max: usize) -> HandlerLimits
Sets the maximum number of push notification configs per task.
Sourcepub const fn with_max_total_push_configs(self, max: usize) -> HandlerLimits
pub const fn with_max_total_push_configs(self, max: usize) -> HandlerLimits
Sets the global (per-tenant for tenant stores) ceiling on total push notification configs. Enforced only when the store reports a count.
Sourcepub const fn with_max_parts_per_artifact(self, max: usize) -> HandlerLimits
pub const fn with_max_parts_per_artifact(self, max: usize) -> HandlerLimits
Sets the maximum number of parts a single artifact may accumulate.
Sourcepub const fn with_max_context_locks(self, max: usize) -> HandlerLimits
pub const fn with_max_context_locks(self, max: usize) -> HandlerLimits
Sets the maximum number of per-context locks before cleanup.
Sourcepub const fn with_max_buffered_event_bytes(self, max: usize) -> HandlerLimits
pub const fn with_max_buffered_event_bytes(self, max: usize) -> HandlerLimits
Bounds the bytes of events held in event queues at once, across
every task; see
max_buffered_event_bytes.
Sourcepub const fn with_saturation_readiness(
self,
unready_at: u8,
ready_at: u8,
) -> HandlerLimits
pub const fn with_saturation_readiness( self, unready_at: u8, ready_at: u8, ) -> HandlerLimits
Makes /ready answer "saturated" from unready_at percent of
capacity until ready_at percent or below; see
saturation_readiness.
Trait Implementations§
Source§impl Clone for HandlerLimits
impl Clone for HandlerLimits
Source§fn clone(&self) -> HandlerLimits
fn clone(&self) -> HandlerLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HandlerLimits
impl Debug for HandlerLimits
Source§impl Default for HandlerLimits
impl Default for HandlerLimits
Source§fn default() -> HandlerLimits
fn default() -> HandlerLimits
Auto Trait Implementations§
impl Forget for HandlerLimits
impl Freeze for HandlerLimits
impl Move for HandlerLimits
impl RefUnwindSafe for HandlerLimits
impl Send for HandlerLimits
impl Sync for HandlerLimits
impl Unpin for HandlerLimits
impl UnsafeUnpin for HandlerLimits
impl UnwindSafe for HandlerLimits
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].