pub struct MemoryTaskStoreConfig {
pub default_ttl: Duration,
pub cleanup_interval: Duration,
}Expand description
Runtime policy for the in-memory task store.
The default task TTL remains five minutes for source and behavior
compatibility. Final-protocol clients cannot choose a TTL, so
default_ttl is the server’s retention and execution
bound for those tasks. Legacy clients that send an explicit TTL continue
to use that value.
Expiry signalling is scheduled independently of
cleanup_interval. The interval controls only
when expired records are physically removed from memory; at the TTL
deadline the task has already become invisible and its cancellation token
and completion waiters have already been woken.
Fields§
§default_ttl: DurationTTL used when TaskStore::create_task receives None.
cleanup_interval: DurationInterval between automatic physical cleanup passes.
Implementations§
Source§impl MemoryTaskStoreConfig
impl MemoryTaskStoreConfig
Sourcepub fn default_ttl(self, ttl: Duration) -> Self
pub fn default_ttl(self, ttl: Duration) -> Self
Set the TTL used for tasks that do not provide one.
Sourcepub fn cleanup_interval(self, interval: Duration) -> Self
pub fn cleanup_interval(self, interval: Duration) -> Self
Set how frequently expired task records are physically reclaimed.
A zero interval is accepted and treated as one millisecond to avoid a busy cleanup loop.
Trait Implementations§
Source§impl Clone for MemoryTaskStoreConfig
impl Clone for MemoryTaskStoreConfig
Source§fn clone(&self) -> MemoryTaskStoreConfig
fn clone(&self) -> MemoryTaskStoreConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MemoryTaskStoreConfig
Source§impl Debug for MemoryTaskStoreConfig
impl Debug for MemoryTaskStoreConfig
Source§impl Default for MemoryTaskStoreConfig
impl Default for MemoryTaskStoreConfig
impl Eq for MemoryTaskStoreConfig
Source§impl PartialEq for MemoryTaskStoreConfig
impl PartialEq for MemoryTaskStoreConfig
impl StructuralPartialEq for MemoryTaskStoreConfig
Auto Trait Implementations§
impl Freeze for MemoryTaskStoreConfig
impl RefUnwindSafe for MemoryTaskStoreConfig
impl Send for MemoryTaskStoreConfig
impl Sync for MemoryTaskStoreConfig
impl Unpin for MemoryTaskStoreConfig
impl UnsafeUnpin for MemoryTaskStoreConfig
impl UnwindSafe for MemoryTaskStoreConfig
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
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,
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
key and return true if they are equal.