public inbox for [email protected]help / color / mirror / Atom feed
Document WaitForBackgroundWorkerShutdown and fix bgworker typo 3+ messages / 2 participants [nested] [flat]
* Document WaitForBackgroundWorkerShutdown and fix bgworker typo @ 2018-02-09 22:43 Daniel Gustafsson <[email protected]> 0 siblings, 1 reply; 3+ messages in thread From: Daniel Gustafsson @ 2018-02-09 22:43 UTC (permalink / raw) To: pgsql-docs WaitForBackgroundWorkerShutdown() was added in 924bcf4f16d, but never documented which seems like an oversight for such a useful function. The attached patch adds this to bgworker.sgml, and also fixes what I believe are typos in the WaitForBackgroundWorkerStartup paragraph. cheers ./daniel Attachments: [application/octet-stream] bgworker.patch (2.2K, 2-bgworker.patch) download | inline diff: From 2a67096e1f55b8f5489d6865c7ec3c86771500b4 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson <[email protected]> Date: Fri, 9 Feb 2018 23:22:02 +0100 Subject: [PATCH] doc: Add WaitForBackgroundWorkerShutdown() to bgw docs Commit 924bcf4f16d extended the background worker API with WaitForBackgroundWorkerShutdown, but it was never added to the documentation. Extend the bgworker docs, and also fix two small spelling errors in the WaitForBackgroundWorkerStartup paragraph. --- doc/src/sgml/bgworker.sgml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/bgworker.sgml b/doc/src/sgml/bgworker.sgml index e490bb8750..099639964c 100644 --- a/doc/src/sgml/bgworker.sgml +++ b/doc/src/sgml/bgworker.sgml @@ -259,13 +259,24 @@ typedef struct BackgroundWorker <function>WaitForBackgroundWorkerStartup(<parameter>BackgroundWorkerHandle *handle</parameter>, <parameter>pid_t *</parameter>)</function> function. This function will block until the postmaster has attempted to start the - background worker, or until the postmaster dies. If the background runner - is running, the return value will <literal>BGWH_STARTED</literal>, and + background worker, or until the postmaster dies. If the background worker + is running, the return value will be <literal>BGWH_STARTED</literal>, and the PID will be written to the provided address. Otherwise, the return value will be <literal>BGWH_STOPPED</literal> or <literal>BGWH_POSTMASTER_DIED</literal>. </para> + <para> + A process can also wait for a background worker to shut down, by using the + <function>WaitForBackgroundWorkerShutdown(<parameter>BackgroundWorkerHandle + *handle</parameter>)</function> function and pass the + <type>BackgroundWorkerHandle *</type> obtained at registration. This + function will block until the background worker exits, or the postmaster + dies. When the background worker exits, the return value is + <literal>BGWH_STOPPED</literal>, if the postmaster dies it will return + <literal>BGWH_POSTMASTER_DIED</literal>. + </para> + <para> If a background worker sends asynchronous notifications with the <command>NOTIFY</command> command via the Server Programming Interface -- 2.14.1.145.gb3622a4ee ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Document WaitForBackgroundWorkerShutdown and fix bgworker typo @ 2018-03-01 09:46 Andres Freund <[email protected]> parent: Daniel Gustafsson <[email protected]> 0 siblings, 1 reply; 3+ messages in thread From: Andres Freund @ 2018-03-01 09:46 UTC (permalink / raw) To: Daniel Gustafsson <[email protected]>; +Cc: pgsql-docs On 2018-02-09 23:43:26 +0100, Daniel Gustafsson wrote: > WaitForBackgroundWorkerShutdown() was added in 924bcf4f16d, but never > documented which seems like an oversight for such a useful function. The > attached patch adds this to bgworker.sgml, and also fixes what I believe are > typos in the WaitForBackgroundWorkerStartup paragraph. Pushed, after s/pass/passing/. Thanks, - Andres ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Document WaitForBackgroundWorkerShutdown and fix bgworker typo @ 2018-03-01 09:50 Daniel Gustafsson <[email protected]> parent: Andres Freund <[email protected]> 0 siblings, 0 replies; 3+ messages in thread From: Daniel Gustafsson @ 2018-03-01 09:50 UTC (permalink / raw) To: Andres Freund <[email protected]>; +Cc: pgsql-docs > On 01 Mar 2018, at 17:46, Andres Freund <[email protected]> wrote: > > On 2018-02-09 23:43:26 +0100, Daniel Gustafsson wrote: >> WaitForBackgroundWorkerShutdown() was added in 924bcf4f16d, but never >> documented which seems like an oversight for such a useful function. The >> attached patch adds this to bgworker.sgml, and also fixes what I believe are >> typos in the WaitForBackgroundWorkerStartup paragraph. > > Pushed, after s/pass/passing/. Right, that reads a lot better, thanks! cheers ./daniel ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-03-01 09:50 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-02-09 22:43 Document WaitForBackgroundWorkerShutdown and fix bgworker typo Daniel Gustafsson <[email protected]> 2018-03-01 09:46 ` Andres Freund <[email protected]> 2018-03-01 09:50 ` Daniel Gustafsson <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox