2
0

async.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*-------------------------------------------------------------------------
  2. *
  3. * async.h
  4. * Asynchronous notification: NOTIFY, LISTEN, UNLISTEN
  5. *
  6. * Portions Copyright (c) 1996-2022, 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. #include <signal.h>
  16. /*
  17. * The number of SLRU page buffers we use for the notification queue.
  18. */
  19. #define NUM_NOTIFY_BUFFERS 8
  20. extern PGDLLIMPORT bool Trace_notify;
  21. extern PGDLLIMPORT volatile sig_atomic_t notifyInterruptPending;
  22. extern Size AsyncShmemSize(void);
  23. extern void AsyncShmemInit(void);
  24. extern void NotifyMyFrontEnd(const char *channel,
  25. const char *payload,
  26. int32 srcPid);
  27. /* notify-related SQL statements */
  28. extern void Async_Notify(const char *channel, const char *payload);
  29. extern void Async_Listen(const char *channel);
  30. extern void Async_Unlisten(const char *channel);
  31. extern void Async_UnlistenAll(void);
  32. /* perform (or cancel) outbound notify processing at transaction commit */
  33. extern void PreCommit_Notify(void);
  34. extern void AtCommit_Notify(void);
  35. extern void AtAbort_Notify(void);
  36. extern void AtSubCommit_Notify(void);
  37. extern void AtSubAbort_Notify(void);
  38. extern void AtPrepare_Notify(void);
  39. /* signal handler for inbound notifies (PROCSIG_NOTIFY_INTERRUPT) */
  40. extern void HandleNotifyInterrupt(void);
  41. /* process interrupts */
  42. extern void ProcessNotifyInterrupt(bool flush);
  43. #endif /* ASYNC_H */