[#BloombergLP-ball-AsyncFileObserver-stopPublicationThread]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/AsyncFileObserver.adoc[AsyncFileObserver]::stopPublicationThread
:relfileprefix: ../../../
:mrdocs:

Drain the record queue, then stop the publication thread&period;

== Synopsis

Declared in `&lt;ball&lowbar;asyncfileobserver&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
stopPublicationThread();
----

== Description

Block until all records that were on the record queue upon entry have been published, then stop the publication thread&period; If there is no publication thread this operation has no effect&period; Return 0 on success, and a non&hyphen;zero value if there is an error joining the publication thread&period; Note that log records received by the `publish` method will continue to be added to the queue after the publication thread is stopped&period;

== Return Value

0 on success, and a non&hyphen;zero value otherwise


[.small]#Created with https://www.mrdocs.com[MrDocs]#
