[][src]Struct pgx::bgworkers::BackgroundWorker

pub struct BackgroundWorker {}

Static interface into a running Background Worker

It also provides a few helper functions as wrappers around the global pgx::pg_sys::MyBgworkerEntry

Implementations

impl BackgroundWorker[src]

pub fn get_name() -> &'static str[src]

What is our name?

pub fn get_extra() -> &'static str[src]

Retrieve the extra data provided to the BackgroundWorkerBuilder

pub fn sighup_received() -> bool[src]

Have we received a SIGUP?

pub fn sigterm_received() -> bool[src]

Have we received a SIGTERM?

pub fn wait_latch(timeout: Option<Duration>) -> bool[src]

Wait for the specified amount of time on the background worker's latch

Returns true if we're still supposed to be alive and haven't received a SIGTERM

pub fn worker_continue() -> bool[src]

Is this BackgroundWorker allowed to continue?

pub fn connect_worker_to_spi(dbname: Option<&str>, username: Option<&str>)[src]

Intended to be called once to indicate the database and user to use to connect to via SPI

pub fn attach_signal_handlers(wake: SignalWakeFlags)[src]

Indicate the set of signal handlers we want to receive.

You likely always want to do this:

use pgx::bgworkers::{BackgroundWorker, SignalWakeFlags};
BackgroundWorker::attach_signal_handlers(SignalWakeFlags::SIGHUP | SignalWakeFlags::SIGTERM);

pub fn transaction<F: FnOnce() + UnwindSafe + RefUnwindSafe>(
    transaction_body: F
)
[src]

Once connected to SPI via connect_worker_to_spi(), begin a transaction to use the pgx::Spi interface.

Auto Trait Implementations

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>,