Skip to content

Commit dde5f09

Browse files
committed
Document interaction of bgworkers with LISTEN/NOTIFY.
Thomas Munro and Robert Haas, reviewed by Haribabu Kommi
1 parent b23af45 commit dde5f09

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: doc/src/sgml/bgworker.sgml

+12
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,18 @@ typedef struct BackgroundWorker
277277
<literal>BGWH_POSTMASTER_DIED</literal>.
278278
</para>
279279

280+
<para>
281+
If a background worker sends asynchronous notifications with the
282+
<command>NOTIFY</command> command via the Server Programming Interface
283+
(<acronym>SPI</acronym>), it should call
284+
<function>ProcessCompletedNotifies</function> explicitly after committing
285+
the enclosing transaction so that any notifications can be delivered. If a
286+
background worker registers to receive asynchronous notifications with
287+
the <command>LISTEN</command> through <acronym>SPI</acronym>, the worker
288+
will log those notifications, but there is no programmatic way for the
289+
worker to intercept and respond to those notifications.
290+
</para>
291+
280292
<para>
281293
The <filename>worker_spi</> contrib module contains a working example,
282294
which demonstrates some useful techniques.

0 commit comments

Comments
 (0)