pub struct PauseResumeController { /* private fields */ }Expand description
High-level controller for pausing and resuming workflows by numeric ID.
Internally maps numeric workflow IDs to PauseCheckpoints stored in a
PauseCheckpointStore. Numeric IDs are converted to strings for
compatibility with the checkpoint store’s string-keyed API.
§Example
use oximedia_workflow::pause_resume::PauseResumeController;
let mut ctrl = PauseResumeController::new();
ctrl.pause(42);
assert!(ctrl.is_paused(42));
ctrl.resume(42);
assert!(!ctrl.is_paused(42));Implementations§
Source§impl PauseResumeController
impl PauseResumeController
Sourcepub fn pause(&mut self, workflow_id: u64)
pub fn pause(&mut self, workflow_id: u64)
Pause a workflow by its numeric ID.
If the workflow is already paused this is a no-op (the checkpoint is updated with a fresh timestamp by replacing the entry).
Sourcepub fn resume(&mut self, workflow_id: u64)
pub fn resume(&mut self, workflow_id: u64)
Resume a workflow by removing its pause checkpoint.
If the workflow is not currently paused this is a no-op.
Sourcepub fn is_paused(&self, workflow_id: u64) -> bool
pub fn is_paused(&self, workflow_id: u64) -> bool
Return true if a pause checkpoint exists for the given workflow ID.
Sourcepub fn paused_count(&self) -> usize
pub fn paused_count(&self) -> usize
Return the number of currently paused workflows.
Sourcepub fn paused_ids(&self) -> Vec<u64>
pub fn paused_ids(&self) -> Vec<u64>
List all currently paused workflow IDs.
Trait Implementations§
Source§impl Debug for PauseResumeController
impl Debug for PauseResumeController
Source§impl Default for PauseResumeController
impl Default for PauseResumeController
Source§fn default() -> PauseResumeController
fn default() -> PauseResumeController
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PauseResumeController
impl RefUnwindSafe for PauseResumeController
impl Send for PauseResumeController
impl Sync for PauseResumeController
impl Unpin for PauseResumeController
impl UnsafeUnpin for PauseResumeController
impl UnwindSafe for PauseResumeController
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