pub struct WorkflowWorker { /* private fields */ }Expand description
One distributed workflow worker.
Implementations§
Source§impl WorkflowWorker
impl WorkflowWorker
Sourcepub fn new(
store: Arc<dyn WorkflowStore>,
registry: WorkflowRegistry,
worker: WorkerId,
lease_duration: LeaseDuration,
heartbeat_interval: Duration,
) -> Result<Self, WorkflowWorkerError>
pub fn new( store: Arc<dyn WorkflowStore>, registry: WorkflowRegistry, worker: WorkerId, lease_duration: LeaseDuration, heartbeat_interval: Duration, ) -> Result<Self, WorkflowWorkerError>
Creates a worker with validated heartbeat timing.
§Errors
Rejects a zero heartbeat interval or one not shorter than the lease.
Sourcepub const fn with_missing_definition_retry(self, delay: Duration) -> Self
pub const fn with_missing_definition_retry(self, delay: Duration) -> Self
Overrides the retry delay for definitions absent from this worker.
Sourcepub const fn with_budget_denied_retry(self, delay: Duration) -> Self
pub const fn with_budget_denied_retry(self, delay: Duration) -> Self
Overrides the retry delay when a tenant aggregate budget is exhausted.
Sourcepub fn with_sleeper(self, sleeper: Arc<dyn WorkflowWorkerSleeper>) -> Self
pub fn with_sleeper(self, sleeper: Arc<dyn WorkflowWorkerSleeper>) -> Self
Overrides heartbeat sleeping for deterministic runtimes and tests.
Sourcepub async fn run_once(
&self,
) -> Result<WorkflowWorkerOutcome, WorkflowWorkerError>
pub async fn run_once( &self, ) -> Result<WorkflowWorkerOutcome, WorkflowWorkerError>
Claims and processes at most one task.
§Errors
Returns infrastructure, checkpoint, or restored-budget failures.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowWorker
impl !UnwindSafe for WorkflowWorker
impl Freeze for WorkflowWorker
impl Send for WorkflowWorker
impl Sync for WorkflowWorker
impl Unpin for WorkflowWorker
impl UnsafeUnpin for WorkflowWorker
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