pub struct Timer;Expand description
Creates durable timer conditions for Step waits.
Returning a timer Condition from WaitFor lets Dex wait without keeping a Worker handler running. Creating the Condition itself does not block or start a local timer.
use dex_sdk::{Timer, Wait};
use std::time::Duration;
let wait = Wait::until(Timer::by_duration(Duration::from_secs(30)));Implementations§
Source§impl Timer
impl Timer
Sourcepub fn by_duration(duration: Duration) -> Condition
pub fn by_duration(duration: Duration) -> Condition
Returns a condition that becomes true after duration elapses.
Timer duration is measured by Dex workflow time and survives Worker restarts.
Durations must fit signed 32-bit whole seconds when the Worker submits the wait.
Invalid durations fail wait-result mapping. Use crate::Context::has_timer_fired during
Execute to distinguish a timer from another winning Condition.
Auto Trait Implementations§
impl Forget for Timer
impl Freeze for Timer
impl RefUnwindSafe for Timer
impl Send for Timer
impl Sync for Timer
impl Unpin for Timer
impl UnsafeUnpin for Timer
impl UnwindSafe for Timer
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request