PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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 #include "fmgr.h"
19 
20 /*
21  * The number of SLRU page buffers we use for the notification queue.
22  */
23 #define NUM_ASYNC_BUFFERS 8
24 
25 extern bool Trace_notify;
26 extern volatile sig_atomic_t notifyInterruptPending;
27 
28 extern Size AsyncShmemSize(void);
29 extern void AsyncShmemInit(void);
30 
31 extern void NotifyMyFrontEnd(const char *channel,
32  const char *payload,
33  int32 srcPid);
34 
35 /* notify-related SQL statements */
36 extern void Async_Notify(const char *channel, const char *payload);
37 extern void Async_Listen(const char *channel);
38 extern void Async_Unlisten(const char *channel);
39 extern void Async_UnlistenAll(void);
40 
41 /* perform (or cancel) outbound notify processing at transaction commit */
42 extern void PreCommit_Notify(void);
43 extern void AtCommit_Notify(void);
44 extern void AtAbort_Notify(void);
45 extern void AtSubStart_Notify(void);
46 extern void AtSubCommit_Notify(void);
47 extern void AtSubAbort_Notify(void);
48 extern void AtPrepare_Notify(void);
49 extern void ProcessCompletedNotifies(void);
50 
51 /* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */
52 extern void HandleNotifyInterrupt(void);
53 
54 /* process interrupts */
55 extern void ProcessNotifyInterrupt(void);
56 
57 #endif /* ASYNC_H */
void AtSubCommit_Notify(void)
Definition: async.c:1639
void HandleNotifyInterrupt(void)
Definition: async.c:1707
void ProcessNotifyInterrupt(void)
Definition: async.c:1731
void AtSubAbort_Notify(void)
Definition: async.c:1671
signed int int32
Definition: c.h:246
Size AsyncShmemSize(void)
Definition: async.c:426
void Async_UnlistenAll(void)
Definition: async.c:670
void AsyncShmemInit(void)
Definition: async.c:443
bool Trace_notify
Definition: async.c:370
void NotifyMyFrontEnd(const char *channel, const char *payload, int32 srcPid)
Definition: async.c:2096
void Async_Notify(const char *channel, const char *payload)
Definition: async.c:543
void AtAbort_Notify(void)
Definition: async.c:1589
void AtSubStart_Notify(void)
Definition: async.c:1609
void AtPrepare_Notify(void)
Definition: async.c:750
void ProcessCompletedNotifies(void)
Definition: async.c:1101
void AtCommit_Notify(void)
Definition: async.c:874
volatile sig_atomic_t notifyInterruptPending
Definition: async.c:358
void Async_Unlisten(const char *channel)
Definition: async.c:652
size_t Size
Definition: c.h:350
void PreCommit_Notify(void)
Definition: async.c:775
void Async_Listen(const char *channel)
Definition: async.c:638