Struct apalis_sql::postgres::PgListen
source · pub struct PgListen { /* private fields */ }Available on crate feature
postgres only.Expand description
A listener that listens to Postgres notifications
Implementations§
source§impl PgListen
impl PgListen
sourcepub async fn new(pool: PgPool) -> Result<Self, Error>
pub async fn new(pool: PgPool) -> Result<Self, Error>
Build a new listener.
Maintaining a connection can be expensive, its encouraged you only create one PgListen and share it with multiple PostgresStorage
sourcepub fn subscribe<T: Job>(&mut self) -> PgSubscription
pub fn subscribe<T: Job>(&mut self) -> PgSubscription
Add a new subscription
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PgListen
impl Send for PgListen
impl Sync for PgListen
impl Unpin for PgListen
impl !UnwindSafe for PgListen
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