diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:15:05 +0000 |
commit | 46651ce6fe013220ed397add242004d764fc0153 (patch) | |
tree | 6e5299f990f88e60174a1d3ae6e48eedd2688b2b /src/include/commands/async.h | |
parent | Initial commit. (diff) | |
download | postgresql-14-upstream.tar.xz postgresql-14-upstream.zip |
Adding upstream version 14.5.upstream/14.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/include/commands/async.h')
-rw-r--r-- | src/include/commands/async.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/include/commands/async.h b/src/include/commands/async.h new file mode 100644 index 0000000..85bfb24 --- /dev/null +++ b/src/include/commands/async.h @@ -0,0 +1,54 @@ +/*------------------------------------------------------------------------- + * + * async.h + * Asynchronous notification: NOTIFY, LISTEN, UNLISTEN + * + * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/include/commands/async.h + * + *------------------------------------------------------------------------- + */ +#ifndef ASYNC_H +#define ASYNC_H + +#include <signal.h> + +/* + * The number of SLRU page buffers we use for the notification queue. + */ +#define NUM_NOTIFY_BUFFERS 8 + +extern bool Trace_notify; +extern volatile sig_atomic_t notifyInterruptPending; + +extern Size AsyncShmemSize(void); +extern void AsyncShmemInit(void); + +extern void NotifyMyFrontEnd(const char *channel, + const char *payload, + int32 srcPid); + +/* notify-related SQL statements */ +extern void Async_Notify(const char *channel, const char *payload); +extern void Async_Listen(const char *channel); +extern void Async_Unlisten(const char *channel); +extern void Async_UnlistenAll(void); + +/* perform (or cancel) outbound notify processing at transaction commit */ +extern void PreCommit_Notify(void); +extern void AtCommit_Notify(void); +extern void AtAbort_Notify(void); +extern void AtSubCommit_Notify(void); +extern void AtSubAbort_Notify(void); +extern void AtPrepare_Notify(void); +extern void ProcessCompletedNotifies(void); + +/* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */ +extern void HandleNotifyInterrupt(void); + +/* process interrupts */ +extern void ProcessNotifyInterrupt(bool flush); + +#endif /* ASYNC_H */ |