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-2023, 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 
18 /*
19  * The number of SLRU page buffers we use for the notification queue.
20  */
21 #define NUM_NOTIFY_BUFFERS 8
22 
23 extern PGDLLIMPORT bool Trace_notify;
25 extern PGDLLIMPORT volatile sig_atomic_t notifyInterruptPending;
26 
27 extern Size AsyncShmemSize(void);
28 extern void AsyncShmemInit(void);
29 
30 extern void NotifyMyFrontEnd(const char *channel,
31  const char *payload,
32  int32 srcPid);
33 
34 /* notify-related SQL statements */
35 extern void Async_Notify(const char *channel, const char *payload);
36 extern void Async_Listen(const char *channel);
37 extern void Async_Unlisten(const char *channel);
38 extern void Async_UnlistenAll(void);
39 
40 /* perform (or cancel) outbound notify processing at transaction commit */
41 extern void PreCommit_Notify(void);
42 extern void AtCommit_Notify(void);
43 extern void AtAbort_Notify(void);
44 extern void AtSubCommit_Notify(void);
45 extern void AtSubAbort_Notify(void);
46 extern void AtPrepare_Notify(void);
47 
48 /* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */
49 extern void HandleNotifyInterrupt(void);
50 
51 /* process interrupts */
52 extern void ProcessNotifyInterrupt(bool flush);
53 
54 #endif /* ASYNC_H */
void HandleNotifyInterrupt(void)
Definition: async.c:1796
PGDLLIMPORT bool Trace_notify
Definition: async.c:427
void Async_UnlistenAll(void)
Definition: async.c:776
void NotifyMyFrontEnd(const char *channel, const char *payload, int32 srcPid)
Definition: async.c:2216
void AtCommit_Notify(void)
Definition: async.c:974
void ProcessNotifyInterrupt(bool flush)
Definition: async.c:1826
PGDLLIMPORT volatile sig_atomic_t notifyInterruptPending
Definition: async.c:415
void AtAbort_Notify(void)
Definition: async.c:1663
void PreCommit_Notify(void)
Definition: async.c:867
Size AsyncShmemSize(void)
Definition: async.c:487
void Async_Unlisten(const char *channel)
Definition: async.c:758
void Async_Listen(const char *channel)
Definition: async.c:744
void AtSubAbort_Notify(void)
Definition: async.c:1753
void AtPrepare_Notify(void)
Definition: async.c:842
PGDLLIMPORT int max_notify_queue_pages
Definition: async.c:430
void AtSubCommit_Notify(void)
Definition: async.c:1683
void AsyncShmemInit(void)
Definition: async.c:504
void Async_Notify(const char *channel, const char *payload)
Definition: async.c:597
#define PGDLLIMPORT
Definition: c.h:1326
signed int int32
Definition: c.h:483
size_t Size
Definition: c.h:594