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-2016, 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 /* notify-related SQL statements */
32 extern void Async_Notify(const char *channel, const char *payload);
33 extern void Async_Listen(const char *channel);
34 extern void Async_Unlisten(const char *channel);
35 extern void Async_UnlistenAll(void);
36 
37 /* notify-related SQL functions */
41 
42 /* perform (or cancel) outbound notify processing at transaction commit */
43 extern void PreCommit_Notify(void);
44 extern void AtCommit_Notify(void);
45 extern void AtAbort_Notify(void);
46 extern void AtSubStart_Notify(void);
47 extern void AtSubCommit_Notify(void);
48 extern void AtSubAbort_Notify(void);
49 extern void AtPrepare_Notify(void);
50 extern void ProcessCompletedNotifies(void);
51 
52 /* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */
53 extern void HandleNotifyInterrupt(void);
54 
55 /* process interrupts */
56 extern void ProcessNotifyInterrupt(void);
57 
58 #endif /* ASYNC_H */
void AtSubCommit_Notify(void)
Definition: async.c:1637
void HandleNotifyInterrupt(void)
Definition: async.c:1705
void ProcessNotifyInterrupt(void)
Definition: async.c:1729
void AtSubAbort_Notify(void)
Definition: async.c:1669
Datum pg_notify(PG_FUNCTION_ARGS)
Definition: async.c:509
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:368
void Async_Notify(const char *channel, const char *payload)
Definition: async.c:543
void AtAbort_Notify(void)
Definition: async.c:1587
void AtSubStart_Notify(void)
Definition: async.c:1607
void AtPrepare_Notify(void)
Definition: async.c:750
void ProcessCompletedNotifies(void)
Definition: async.c:1099
Datum pg_listening_channels(PG_FUNCTION_ARGS)
Definition: async.c:690
void AtCommit_Notify(void)
Definition: async.c:874
uintptr_t Datum
Definition: postgres.h:374
Datum pg_notification_queue_usage(PG_FUNCTION_ARGS)
Definition: async.c:1414
volatile sig_atomic_t notifyInterruptPending
Definition: async.c:356
void Async_Unlisten(const char *channel)
Definition: async.c:652
size_t Size
Definition: c.h:352
void PreCommit_Notify(void)
Definition: async.c:775
void Async_Listen(const char *channel)
Definition: async.c:638
#define PG_FUNCTION_ARGS
Definition: fmgr.h:150