[][src]Struct coil::Runner

pub struct Runner<Env> { /* fields omitted */ }

Runner for background tasks. Synchronous tasks are run in a threadpool. Asynchronous tasks are spawned on the executor.

Implementations

impl<Env: 'static> Runner<Env>[src]

pub fn builder(
    env: Env,
    executor: impl Spawn + 'static,
    conn: &PgPool
) -> Builder<Env>
[src]

Build the builder for Runner

pub async fn connection<'_>(&'_ self) -> Result<PoolConnection<Postgres>, Error>[src]

Get a Pool Connection from the pool that the runner is using.

pub fn connection_pool(&self) -> PgPool[src]

Get the connection pool that the runner is using

impl<Env: Send + Sync + RefUnwindSafe + 'static> Runner<Env>[src]

pub async fn run_all_sync_tasks<'_>(&'_ self) -> Result<usize, FetchError>[src]

Run all synchronous tasks Spawns synchronous tasks onto a rayon threadpool Returns how many tasks were actually queued

pub async fn run_all_async_tasks<'_>(&'_ self) -> Result<usize, FetchError>[src]

Run all asynchronous tasks Spawns asynchronous tasks onto the specified executor Returns how many tasks were actually queued

Auto Trait Implementations

impl<Env> !RefUnwindSafe for Runner<Env>

impl<Env> !Send for Runner<Env>

impl<Env> !Sync for Runner<Env>

impl<Env> Unpin for Runner<Env>

impl<Env> !UnwindSafe for Runner<Env>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,