[−][src]Struct pgx::bgworkers::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]
transaction_body: F
)
Once connected to SPI via connect_worker_to_spi()
, begin a transaction to
use the pgx::Spi
interface.
Auto Trait Implementations
impl RefUnwindSafe for BackgroundWorker
impl Send for BackgroundWorker
impl Sync for BackgroundWorker
impl Unpin for BackgroundWorker
impl UnwindSafe for BackgroundWorker
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>,