Trait concurrency_traits::queue::AsyncTimeoutQueue[][src]

pub trait AsyncTimeoutQueue: TryQueue {
    #[must_use]
    fn push_timeout_async<'life0, 'async_trait>(
        &'life0 self,
        value: Self::Item,
        timeout: Duration
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Item>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn pop_timeout_async<'life0, 'async_trait>(
        &'life0 self,
        timeout: Duration
    ) -> Pin<Box<dyn Future<Output = Option<Self::Item>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

An Async Queue that can timeout on push and pop operations

Required methods

#[must_use]
fn push_timeout_async<'life0, 'async_trait>(
    &'life0 self,
    value: Self::Item,
    timeout: Duration
) -> Pin<Box<dyn Future<Output = Result<(), Self::Item>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Pushes an item to the queue asynchronously with a timeout

#[must_use]
fn pop_timeout_async<'life0, 'async_trait>(
    &'life0 self,
    timeout: Duration
) -> Pin<Box<dyn Future<Output = Option<Self::Item>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Pops an item from the queue asynchronously with a timeout

Implementors

impl<T, S, CS> AsyncTimeoutQueue for SemaphoreQueue<T, S, CS> where
    T: Send,
    S: AsyncTimeoutSemaphore + Send + Sync,
    CS: ThreadFunctions
[src]

fn push_timeout_async<'life0, 'async_trait>(
    &'life0 self,
    value: Self::Item,
    __arg2: Duration
) -> Pin<Box<dyn Future<Output = Result<(), Self::Item>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

fn pop_timeout_async<'life0, 'async_trait>(
    &'life0 self,
    timeout: Duration
) -> Pin<Box<dyn Future<Output = Option<Self::Item>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]