PostgreSQL Source Code git master
async.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * async.h
4 * Asynchronous notification: NOTIFY, LISTEN, UNLISTEN
5 *
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
8 *
9 * src/include/commands/async.h
10 *
11 *-------------------------------------------------------------------------
12 */
13#ifndef ASYNC_H
14#define ASYNC_H
15
16#include <signal.h>
17
18extern PGDLLIMPORT bool Trace_notify;
20extern PGDLLIMPORT volatile sig_atomic_t notifyInterruptPending;
21
22extern Size AsyncShmemSize(void);
23extern void AsyncShmemInit(void);
24
25extern void NotifyMyFrontEnd(const char *channel,
26 const char *payload,
27 int32 srcPid);
28
29/* notify-related SQL statements */
30extern void Async_Notify(const char *channel, const char *payload);
31extern void Async_Listen(const char *channel);
32extern void Async_Unlisten(const char *channel);
33extern void Async_UnlistenAll(void);
34
35/* perform (or cancel) outbound notify processing at transaction commit */
36extern void PreCommit_Notify(void);
37extern void AtCommit_Notify(void);
38extern void AtAbort_Notify(void);
39extern void AtSubCommit_Notify(void);
40extern void AtSubAbort_Notify(void);
41extern void AtPrepare_Notify(void);
42
43/* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */
44extern void HandleNotifyInterrupt(void);
45
46/* process interrupts */
47extern void ProcessNotifyInterrupt(bool flush);
48
49/* freeze old transaction IDs in notify queue (called by VACUUM) */
50extern void AsyncNotifyFreezeXids(TransactionId newFrozenXid);
51
52#endif /* ASYNC_H */
void HandleNotifyInterrupt(void)
Definition: async.c:1804
PGDLLIMPORT bool Trace_notify
Definition: async.c:425
void Async_UnlistenAll(void)
Definition: async.c:769
void NotifyMyFrontEnd(const char *channel, const char *payload, int32 srcPid)
Definition: async.c:2344
void AtCommit_Notify(void)
Definition: async.c:967
void ProcessNotifyInterrupt(bool flush)
Definition: async.c:1834
PGDLLIMPORT volatile sig_atomic_t notifyInterruptPending
Definition: async.c:413
void AtAbort_Notify(void)
Definition: async.c:1671
void PreCommit_Notify(void)
Definition: async.c:860
Size AsyncShmemSize(void)
Definition: async.c:484
void Async_Unlisten(const char *channel)
Definition: async.c:751
void Async_Listen(const char *channel)
Definition: async.c:737
void AtSubAbort_Notify(void)
Definition: async.c:1761
void AtPrepare_Notify(void)
Definition: async.c:835
PGDLLIMPORT int max_notify_queue_pages
Definition: async.c:428
void AtSubCommit_Notify(void)
Definition: async.c:1691
void AsyncShmemInit(void)
Definition: async.c:501
void Async_Notify(const char *channel, const char *payload)
Definition: async.c:590
void AsyncNotifyFreezeXids(TransactionId newFrozenXid)
Definition: async.c:2196
#define PGDLLIMPORT
Definition: c.h:1310
int32_t int32
Definition: c.h:539
uint32 TransactionId
Definition: c.h:662
size_t Size
Definition: c.h:615