1996-07-09 08:22:35 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* async.h
|
1998-10-06 04:40:09 +02:00
|
|
|
* Asynchronous notification: NOTIFY, LISTEN, UNLISTEN
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2010-01-02 17:58:17 +01:00
|
|
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
2000-01-26 06:58:53 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/include/commands/async.h
|
1996-07-09 08:22:35 +02:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef ASYNC_H
|
|
|
|
#define ASYNC_H
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2010-02-16 23:34:57 +01:00
|
|
|
#include "fmgr.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The number of SLRU page buffers we use for the notification queue.
|
|
|
|
*/
|
|
|
|
#define NUM_ASYNC_BUFFERS 8
|
|
|
|
|
2000-05-31 02:28:42 +02:00
|
|
|
extern bool Trace_notify;
|
|
|
|
|
2010-02-16 23:34:57 +01:00
|
|
|
extern Size AsyncShmemSize(void);
|
|
|
|
extern void AsyncShmemInit(void);
|
|
|
|
|
1998-10-06 04:40:09 +02:00
|
|
|
/* notify-related SQL statements */
|
2010-02-16 23:34:57 +01:00
|
|
|
extern void Async_Notify(const char *channel, const char *payload);
|
|
|
|
extern void Async_Listen(const char *channel);
|
|
|
|
extern void Async_Unlisten(const char *channel);
|
2007-04-12 08:53:49 +02:00
|
|
|
extern void Async_UnlistenAll(void);
|
1996-07-09 08:22:35 +02:00
|
|
|
|
2010-02-16 23:34:57 +01:00
|
|
|
/* notify-related SQL functions */
|
|
|
|
extern Datum pg_listening_channels(PG_FUNCTION_ARGS);
|
|
|
|
extern Datum pg_notify(PG_FUNCTION_ARGS);
|
|
|
|
|
1998-10-06 04:40:09 +02:00
|
|
|
/* perform (or cancel) outbound notify processing at transaction commit */
|
2010-02-16 23:34:57 +01:00
|
|
|
extern void PreCommit_Notify(void);
|
1998-10-06 04:40:09 +02:00
|
|
|
extern void AtCommit_Notify(void);
|
|
|
|
extern void AtAbort_Notify(void);
|
2004-07-01 02:52:04 +02:00
|
|
|
extern void AtSubStart_Notify(void);
|
|
|
|
extern void AtSubCommit_Notify(void);
|
|
|
|
extern void AtSubAbort_Notify(void);
|
2005-06-18 00:32:51 +02:00
|
|
|
extern void AtPrepare_Notify(void);
|
2010-02-16 23:34:57 +01:00
|
|
|
extern void ProcessCompletedNotifies(void);
|
1998-10-06 04:40:09 +02:00
|
|
|
|
2009-07-31 22:26:23 +02:00
|
|
|
/* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */
|
|
|
|
extern void HandleNotifyInterrupt(void);
|
1998-10-06 04:40:09 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* enable/disable processing of inbound notifies directly from signal handler.
|
|
|
|
* The enable routine first performs processing of any inbound notifies that
|
2004-05-23 05:50:45 +02:00
|
|
|
* have occurred since the last disable.
|
1998-10-06 04:40:09 +02:00
|
|
|
*/
|
|
|
|
extern void EnableNotifyInterrupt(void);
|
2004-05-23 05:50:45 +02:00
|
|
|
extern bool DisableNotifyInterrupt(void);
|
2001-10-28 07:26:15 +01:00
|
|
|
|
2001-11-05 18:46:40 +01:00
|
|
|
#endif /* ASYNC_H */
|