Skip to main content

SqliteTimerDriver

Struct SqliteTimerDriver 

Source
pub struct SqliteTimerDriver<C = SystemClock> { /* private fields */ }
Expand description

SQLite-backed durable timer source.

Implementations§

Source§

impl SqliteTimerDriver<SystemClock>

Source

pub fn open(path: impl AsRef<Path>) -> DurableResult<Self>

Open or create a file-backed timer source.

Source

pub fn in_memory() -> DurableResult<Self>

Create an in-memory timer source.

Source§

impl<C: Clock> SqliteTimerDriver<C>

Source

pub fn open_with_clock(path: impl AsRef<Path>, clock: C) -> DurableResult<Self>

Open a file-backed timer source with an injected clock.

Source

pub fn in_memory_with_clock(clock: C) -> DurableResult<Self>

Create an in-memory timer source with an injected clock.

Source

pub fn schedule( &mut self, activation_id: &str, timer_id: &str, due_unix_ms: u64, value: &Value, ) -> DurableResult<()>

Schedule or exactly replay one logical timer delivery.

Trait Implementations§

Source§

impl<C: Clock> WaitSourceDriver for SqliteTimerDriver<C>

Source§

fn receive( &mut self, index: &ParkedWaitIndex, max_targets: usize, ) -> DurableResult<Option<WaitDelivery>>

Return one delivery or None when no work is currently available.
Source§

fn acknowledge(&mut self, activation_id: &str) -> DurableResult<()>

Acknowledge a delivery after its M1 CAS commit.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.