Skip to main content

WaitUntil

Trait WaitUntil 

Source
pub trait WaitUntil: Binding {
    // Required methods
    fn wait_for_drain_signal<'life0, 'async_trait>(
        &'life0 self,
        timeout: Option<Duration>,
    ) -> Pin<Box<dyn Future<Output = Result<DrainConfig>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn drain_all<'life0, 'async_trait>(
        &'life0 self,
        config: DrainConfig,
    ) -> Pin<Box<dyn Future<Output = Result<DrainResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_task_count<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn notify_drain_complete<'life0, 'async_trait>(
        &'life0 self,
        response: DrainResponse,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A trait for wait_until bindings that provide task coordination capabilities. Note: This trait is not object-safe due to generic methods, so we use concrete types in providers.

Required Methods§

Source

fn wait_for_drain_signal<'life0, 'async_trait>( &'life0 self, timeout: Option<Duration>, ) -> Pin<Box<dyn Future<Output = Result<DrainConfig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for a drain signal from the runtime. This is a blocking call that returns when the runtime decides it’s time to drain.

Source

fn drain_all<'life0, 'async_trait>( &'life0 self, config: DrainConfig, ) -> Pin<Box<dyn Future<Output = Result<DrainResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Drains all currently registered tasks. This waits for all tasks to complete or timeout.

Source

fn get_task_count<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the current number of registered tasks.

Source

fn notify_drain_complete<'life0, 'async_trait>( &'life0 self, response: DrainResponse, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Notifies the runtime that draining is complete.

Implementors§