pub struct A2aTaskRetention {
pub max_finished: Option<usize>,
pub ttl: Option<Duration>,
}Expand description
How many finished A2A task records a TaskStore keeps, and for how long.
A record is kept so tasks/get can report the outcome after message/send
returns. Every record in the store belongs to an execution that has ended —
running tasks are tracked separately and are never evicted.
The default keeps the newest 1,000 records for at most one hour.
§Example
use adk_server::A2aTaskRetention;
use std::time::Duration;
let retention =
A2aTaskRetention::default().with_max_finished(500).with_ttl(Duration::from_secs(600));
assert_eq!(retention.max_finished, Some(500));
assert_eq!(retention.ttl, Some(Duration::from_secs(600)));Fields§
§max_finished: Option<usize>How many finished task records to keep, newest first. None keeps every record.
ttl: Option<Duration>How long a finished task record stays readable. None disables expiry.
Implementations§
Source§impl A2aTaskRetention
impl A2aTaskRetention
Sourcepub fn unlimited() -> Self
pub fn unlimited() -> Self
Keeps every finished task record forever. The store then grows without bound.
Sourcepub fn with_max_finished(self, count: usize) -> Self
pub fn with_max_finished(self, count: usize) -> Self
Keeps at most count finished task records, evicting the oldest first.
Trait Implementations§
Source§impl Clone for A2aTaskRetention
impl Clone for A2aTaskRetention
impl Copy for A2aTaskRetention
Source§impl Debug for A2aTaskRetention
impl Debug for A2aTaskRetention
Source§impl Default for A2aTaskRetention
impl Default for A2aTaskRetention
impl Eq for A2aTaskRetention
Source§impl PartialEq for A2aTaskRetention
impl PartialEq for A2aTaskRetention
impl StructuralPartialEq for A2aTaskRetention
Auto Trait Implementations§
impl Freeze for A2aTaskRetention
impl RefUnwindSafe for A2aTaskRetention
impl Send for A2aTaskRetention
impl Sync for A2aTaskRetention
impl Unpin for A2aTaskRetention
impl UnsafeUnpin for A2aTaskRetention
impl UnwindSafe for A2aTaskRetention
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.