pub struct CleanupConfig {
pub task_retention_duration: Duration,
pub cleanup_interval: Duration,
pub enable_automatic_cleanup: bool,
pub max_retained_tasks: usize,
}Expand description
Configuration for task metadata cleanup.
Controls how and when completed task metadata is removed from memory to prevent memory leaks in long-running executors.
Fields§
§task_retention_duration: DurationHow long to keep completed task metadata before cleanup
§Default: 5 minutes
§Range: 1 second to task_retention_duration
cleanup_interval: DurationHow often to run the cleanup process
§Default: 30 seconds
§Range: 1 second to task_retention_duration
enable_automatic_cleanup: boolWhether to enable automatic cleanup
If disabled, cleanup must be triggered manually via cleanup_completed_tasks()
§Default: true
max_retained_tasks: usizeMaximum number of completed tasks to retain regardless of age
This provides a hard limit to prevent unbounded memory growth
§Default: 10,000 tasks
Trait Implementations§
Source§impl Clone for CleanupConfig
impl Clone for CleanupConfig
Source§fn clone(&self) -> CleanupConfig
fn clone(&self) -> CleanupConfig
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 CleanupConfig
impl Debug for CleanupConfig
Auto Trait Implementations§
impl Freeze for CleanupConfig
impl RefUnwindSafe for CleanupConfig
impl Send for CleanupConfig
impl Sync for CleanupConfig
impl Unpin for CleanupConfig
impl UnsafeUnpin for CleanupConfig
impl UnwindSafe for CleanupConfig
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