Skip to main content

RunCoordinator

Trait RunCoordinator 

Source
pub trait RunCoordinator: Send + Sync {
    // Required methods
    fn acquire<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 ThreadKey,
        run_id: &'life2 RunId,
        lease_ms: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RunLease>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn renew<'life0, 'life1, 'async_trait>(
        &'life0 self,
        lease: &'life1 RunLease,
        lease_ms: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Option<RunLease>, StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn release<'life0, 'life1, 'async_trait>(
        &'life0 self,
        lease: &'life1 RunLease,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Coordinates exclusive execution of one thread inside one live process.

Required Methods§

Source

fn acquire<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key: &'life1 ThreadKey, run_id: &'life2 RunId, lease_ms: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<RunLease>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Attempts to acquire a process-local lease for a run.

Source

fn renew<'life0, 'life1, 'async_trait>( &'life0 self, lease: &'life1 RunLease, lease_ms: u64, ) -> Pin<Box<dyn Future<Output = Result<Option<RunLease>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Renews a lease if the caller still owns its fencing token.

Source

fn release<'life0, 'life1, 'async_trait>( &'life0 self, lease: &'life1 RunLease, ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Releases a lease if the caller still owns its fencing token.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§