pub struct LeanWorkerRestartPolicy { /* private fields */ }Expand description
Policy for cycling a worker child before the next request.
The policy resets retained Lean runtime memory only by restarting the
process. It does not change lean-rs-host’s in-process memory model, and it
does not imply that SessionPool::drain() can return process-global Lean
memory to the OS.
Implementations§
Source§impl LeanWorkerRestartPolicy
impl LeanWorkerRestartPolicy
Sourcepub fn max_requests(self, limit: u64) -> Self
pub fn max_requests(self, limit: u64) -> Self
Restart before a request when this many requests have entered the child.
Sourcepub fn max_imports(self, limit: u64) -> Self
pub fn max_imports(self, limit: u64) -> Self
Restart before an import-like request when this many imports have run.
Sourcepub fn max_rss_kib(self, limit: u64) -> Self
pub fn max_rss_kib(self, limit: u64) -> Self
Restart before a request when measured child RSS is at least this many KiB.
RSS measurement is best effort. It is implemented for the current
supported Unix development targets; unsupported platforms skip the
check and increment LeanWorkerStats::rss_samples_unavailable.
Sourcepub fn idle_restart_after(self, duration: Duration) -> Self
pub fn idle_restart_after(self, duration: Duration) -> Self
Restart before a request when the worker has been idle for this long.
Trait Implementations§
Source§impl Clone for LeanWorkerRestartPolicy
impl Clone for LeanWorkerRestartPolicy
Source§fn clone(&self) -> LeanWorkerRestartPolicy
fn clone(&self) -> LeanWorkerRestartPolicy
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 LeanWorkerRestartPolicy
impl Debug for LeanWorkerRestartPolicy
Source§impl Default for LeanWorkerRestartPolicy
impl Default for LeanWorkerRestartPolicy
Source§fn default() -> LeanWorkerRestartPolicy
fn default() -> LeanWorkerRestartPolicy
Source§impl PartialEq for LeanWorkerRestartPolicy
impl PartialEq for LeanWorkerRestartPolicy
Source§fn eq(&self, other: &LeanWorkerRestartPolicy) -> bool
fn eq(&self, other: &LeanWorkerRestartPolicy) -> bool
self and other values to be equal, and is used by ==.