#[non_exhaustive]pub struct OperationsOptions {
pub routes: bool,
pub watchdog: bool,
pub heartbeat_secs: u64,
pub stale_after_secs: u64,
pub max_redispatches: u32,
pub progress_interval_ms: u64,
pub stream_poll_ms: u64,
pub view_permission: String,
pub cancel_permission: String,
}Expand description
Operations settings: configuration section queue.operations.
[queue.operations]
routes = true # GET/DELETE /api/operations/{id}, the SSE stream
watchdog = true # sweep stale operations every minute (with ScheduleModule)
heartbeat_secs = 30 # how often a running job's operation shows it is alive
stale_after_secs = 300 # no heartbeat for this long: the watchdog steps in
max_redispatches = 3 # restarts of an idempotent operation's job
progress_interval_ms = 500 # ctx.progress writes at most this often per job
stream_poll_ms = 1000 # how often an SSE stream re-reads the operation
view_permission = "operations.view" # see other users' operations
cancel_permission = "operations.cancel"Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.routes: boolMounts the /api/operations routes (default true; they also need
DatabaseModule and an authenticator).
watchdog: boolSchedules the watchdog (Operations::sweep)
every minute, as task queue.watchdog, in apps with
ScheduleModule (default true). Without ScheduleModule, run
queue:watchdog every minute from system cron instead.
heartbeat_secs: u64How often the worker renews the heartbeat of a running job’s operation, in seconds (default 30).
stale_after_secs: u64A pending or running operation without a heartbeat for this many
seconds is stale (default 300): see queue:watchdog.
max_redispatches: u32How many times the watchdog dispatches the job of a stale idempotent operation again before failing it (default 3).
progress_interval_ms: u64ctx.progress writes to the database at most this often per job, in
milliseconds (default 500); a report with done == total is always
written.
stream_poll_ms: u64How often an SSE stream re-reads its operation, in milliseconds (default 1000). Changes made in the same process arrive at once.
view_permission: StringThe permission that shows other users’ operations (default
operations.view), app-wide or in the operation’s workspace.
cancel_permission: StringThe permission that cancels other users’ operations (default
operations.cancel).
Implementations§
Source§impl OperationsOptions
impl OperationsOptions
Sourcepub fn heartbeat_interval(&self) -> Duration
pub fn heartbeat_interval(&self) -> Duration
heartbeat_secs as a Duration.
Sourcepub fn progress_interval(&self) -> Duration
pub fn progress_interval(&self) -> Duration
progress_interval_ms as
a Duration.
Sourcepub fn stream_poll_interval(&self) -> Duration
pub fn stream_poll_interval(&self) -> Duration
stream_poll_ms as a
Duration.
Trait Implementations§
Source§impl Clone for OperationsOptions
impl Clone for OperationsOptions
Source§impl ConfigTable for OperationsOptions
impl ConfigTable for OperationsOptions
Source§impl Debug for OperationsOptions
impl Debug for OperationsOptions
Source§impl Default for OperationsOptions
impl Default for OperationsOptions
Source§impl<'de> Deserialize<'de> for OperationsOptionswhere
OperationsOptions: Default,
impl<'de> Deserialize<'de> for OperationsOptionswhere
OperationsOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for OperationsOptions
Source§impl PartialEq for OperationsOptions
impl PartialEq for OperationsOptions
Source§impl Serialize for OperationsOptions
impl Serialize for OperationsOptions
impl StructuralPartialEq for OperationsOptions
Auto Trait Implementations§
impl Forget for OperationsOptions
impl Freeze for OperationsOptions
impl Move for OperationsOptions
impl RefUnwindSafe for OperationsOptions
impl Send for OperationsOptions
impl Sync for OperationsOptions
impl Unpin for OperationsOptions
impl UnsafeUnpin for OperationsOptions
impl UnwindSafe for OperationsOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more