pub enum BackpressurePolicy {
Queue,
Fail,
}Expand description
Policy for handling excess tool calls when the concurrency limit is reached.
Determines whether tool calls that exceed the configured concurrency limit should wait in a queue or fail immediately.
§Example
use adk_core::BackpressurePolicy;
// Default is Queue
let policy = BackpressurePolicy::default();
assert!(matches!(policy, BackpressurePolicy::Queue));Variants§
Queue
Queue excess calls until a permit becomes available.
This is the default policy. Tool calls will await until a semaphore permit is released by a completing tool execution.
Fail
Fail immediately with a concurrency limit error when no permit is available.
Use this when latency is more important than throughput — callers receive an immediate error rather than waiting indefinitely.
Trait Implementations§
Source§impl Clone for BackpressurePolicy
impl Clone for BackpressurePolicy
Source§fn clone(&self) -> BackpressurePolicy
fn clone(&self) -> BackpressurePolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BackpressurePolicy
impl Debug for BackpressurePolicy
Source§impl Default for BackpressurePolicy
impl Default for BackpressurePolicy
Source§fn default() -> BackpressurePolicy
fn default() -> BackpressurePolicy
Returns the “default value” for a type. Read more
Source§impl PartialEq for BackpressurePolicy
impl PartialEq for BackpressurePolicy
Source§fn eq(&self, other: &BackpressurePolicy) -> bool
fn eq(&self, other: &BackpressurePolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for BackpressurePolicy
impl StructuralPartialEq for BackpressurePolicy
Auto Trait Implementations§
impl Freeze for BackpressurePolicy
impl RefUnwindSafe for BackpressurePolicy
impl Send for BackpressurePolicy
impl Sync for BackpressurePolicy
impl Unpin for BackpressurePolicy
impl UnsafeUnpin for BackpressurePolicy
impl UnwindSafe for BackpressurePolicy
Blanket Implementations§
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
Mutably borrows from an owned value. Read more