[−][src]Struct coil::Runner
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]
env: Env,
executor: impl Spawn + 'static,
conn: &PgPool
) -> Builder<Env>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,