codekingpro/portable-devtools
115k
1/*-------------------------------------------------------------------------2 *3 * async.h4 * Asynchronous notification: NOTIFY, LISTEN, UNLISTEN5 *6 * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group7 * Portions Copyright (c) 1994, Regents of the University of California8 *9 * src/include/commands/async.h10 *11 *-------------------------------------------------------------------------12 */13#ifndef ASYNC_H14#define ASYNC_H15 16#include <signal.h>17 18/*19 * The number of SLRU page buffers we use for the notification queue.20 */21#define NUM_NOTIFY_BUFFERS 822 23extern PGDLLIMPORT bool Trace_notify;24extern PGDLLIMPORT volatile sig_atomic_t notifyInterruptPending;25 26extern Size AsyncShmemSize(void);27extern void AsyncShmemInit(void);28 29extern void NotifyMyFrontEnd(const char *channel,30 const char *payload,31 int32 srcPid);32 33/* notify-related SQL statements */34extern void Async_Notify(const char *channel, const char *payload);35extern void Async_Listen(const char *channel);36extern void Async_Unlisten(const char *channel);37extern void Async_UnlistenAll(void);38 39/* perform (or cancel) outbound notify processing at transaction commit */40extern void PreCommit_Notify(void);41extern void AtCommit_Notify(void);42extern void AtAbort_Notify(void);43extern void AtSubCommit_Notify(void);44extern void AtSubAbort_Notify(void);45extern void AtPrepare_Notify(void);46 47/* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */48extern void HandleNotifyInterrupt(void);49 50/* process interrupts */51extern void ProcessNotifyInterrupt(bool flush);52 53#endif /* ASYNC_H */54 