pub struct PostgresStorageFactory { /* private fields */ }Expand description
A factory for creating PostgreSQL-backed task queues.
PostgresStorageFactory maintains a shared PostgreSQL LISTEN connection
and routes job insertion notifications to the corresponding queue.
Each queue created by the factory is identified by its queue name. Multiple backends can therefore share a single notification listener while retaining independent task polling and processing.
§Example
ⓘ
use apalis_core::backend::factory::BackendFactory;
use apalis_postgres::factory::PostgresStorageFactory;
use sqlx::PgPool;
let pool = PgPool::connect("postgres://localhost/apalis").await?;
let mut factory = PostgresStorageFactory::new(pool);
let backend = factory.create::<u64>()?;Implementations§
Trait Implementations§
Source§impl<Args> BackendFactory<Args> for PostgresStorageFactory
impl<Args> BackendFactory<Args> for PostgresStorageFactory
Source§type Backend = PollWith<PostgresStorage<Args>, StreamStrategy<SharedFetcher>>
type Backend = PollWith<PostgresStorage<Args>, StreamStrategy<SharedFetcher>>
The backend type produced by this factory.
Source§type Error = PostgresFactoryError
type Error = PostgresFactoryError
The error returned if backend creation fails.
Auto Trait Implementations§
impl !RefUnwindSafe for PostgresStorageFactory
impl !UnwindSafe for PostgresStorageFactory
impl Freeze for PostgresStorageFactory
impl Send for PostgresStorageFactory
impl Sync for PostgresStorageFactory
impl Unpin for PostgresStorageFactory
impl UnsafeUnpin for PostgresStorageFactory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more