[#BloombergLP-ball-MultiplexObserver-registerObserver]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/MultiplexObserver.adoc[MultiplexObserver]::registerObserver
:relfileprefix: ../../../
:mrdocs:

Add the specified `observer` to the registry of this multiplexing observer&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
registerObserver(xref:BloombergLP/ball/Observer.adoc[Observer]* observer);
----

== Description

Add the specified `observer` to the registry of this multiplexing observer&period; Return 0 if `observer` is non&hyphen;null and was not already registered with this multiplexing observer, and a non&hyphen;zero value (with no effect) otherwise&period; Henceforth, this multiplexing observer will forward each record it receives through its `publish` method, including the record&apos;s context, to the `publish` method of `observer`, until `observer` is deregistered&period; The behavior is undefined unless `observer` remains valid until it is deregistered from this multiplexing observer or until this observer is destroyed&period;

== Return Value

0 if `observer` was registered, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *observer*
| observer to register with this multiplexing observer
|===


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