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-2019, 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_ASYNC_BUFFERS 8
22 
23 extern bool Trace_notify;
24 extern volatile sig_atomic_t notifyInterruptPending;
25 
26 extern Size AsyncShmemSize(void);
27 extern void AsyncShmemInit(void);
28 
29 extern void NotifyMyFrontEnd(const char *channel,
30  const char *payload,
31  int32 srcPid);
32 
33 /* notify-related SQL statements */
34 extern void Async_Notify(const char *channel, const char *payload);
35 extern void Async_Listen(const char *channel);
36 extern void Async_Unlisten(const char *channel);
37 extern void Async_UnlistenAll(void);
38 
39 /* perform (or cancel) outbound notify processing at transaction commit */
40 extern void PreCommit_Notify(void);
41 extern void AtCommit_Notify(void);
42 extern void AtAbort_Notify(void);
43 extern void AtSubStart_Notify(void);
44 extern void AtSubCommit_Notify(void);
45 extern void AtSubAbort_Notify(void);
46 extern void AtPrepare_Notify(void);
47 extern void ProcessCompletedNotifies(void);
48 
49 /* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */
50 extern void HandleNotifyInterrupt(void);
51 
52 /* process interrupts */
53 extern void ProcessNotifyInterrupt(void);
54 
55 #endif /* ASYNC_H */
void AtSubCommit_Notify(void)
Definition: async.c:1744
void HandleNotifyInterrupt(void)
Definition: async.c:1837
void ProcessNotifyInterrupt(void)
Definition: async.c:1861
void AtSubAbort_Notify(void)
Definition: async.c:1801
signed int int32
Definition: c.h:346
Size AsyncShmemSize(void)
Definition: async.c:493
void Async_UnlistenAll(void)
Definition: async.c:759
void AsyncShmemInit(void)
Definition: async.c:510
bool Trace_notify
Definition: async.c:425
void NotifyMyFrontEnd(const char *channel, const char *payload, int32 srcPid)
Definition: async.c:2214
void Async_Notify(const char *channel, const char *payload)
Definition: async.c:610
void AtAbort_Notify(void)
Definition: async.c:1694
void AtSubStart_Notify(void)
Definition: async.c:1714
void AtPrepare_Notify(void)
Definition: async.c:825
void ProcessCompletedNotifies(void)
Definition: async.c:1184
void AtCommit_Notify(void)
Definition: async.c:949
volatile sig_atomic_t notifyInterruptPending
Definition: async.c:410
void Async_Unlisten(const char *channel)
Definition: async.c:741
size_t Size
Definition: c.h:466
void PreCommit_Notify(void)
Definition: async.c:850
void Async_Listen(const char *channel)
Definition: async.c:727