<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ --> 

<refentry xml:id="function.mongodb.driver.monitoring.addsubscriber" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>MongoDB\Driver\Monitoring\addSubscriber</refname>
  <refpurpose>Registers a monitoring event subscriber globally</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>void</type><methodname>MongoDB\Driver\Monitoring\addSubscriber</methodname>
   <methodparam><type>MongoDB\Driver\Monitoring\Subscriber</type><parameter>subscriber</parameter></methodparam>
  </methodsynopsis>
  <para>
   Registers a monitoring event subscriber globally. The subscriber will be
   notified of all events in the driver for any Manager.
  </para>
  <note>
   <simpara>
    If <parameter>subscriber</parameter> is already registered globally, this
    function is a no-op. If <parameter>subscriber</parameter> is also registered
    with one or more Managers, it will still only be notified once of each event
    for each Manager.
   </simpara>
  </note>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <variablelist>
   <varlistentry>
    <term><parameter>subscriber</parameter> (<type>MongoDB\Driver\Monitoring\Subscriber</type>)</term>
    <listitem>
     <para>
      A monitoring event subscriber to register globally.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.void;
  </para>
 </refsect1>

 <refsect1 role="errors">
  &reftitle.errors;
  <simplelist>
   &mongodb.throws.argumentparsing;
  </simplelist>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><function>MongoDB\Driver\Monitoring\removeSubscriber</function></member>
   <member><interfacename>MongoDB\Driver\Monitoring\Subscriber</interfacename></member>
   <member><interfacename>MongoDB\Driver\Monitoring\CommandSubscriber</interfacename></member>
   <member><function>MongoDB\Driver\Manager::addSubscriber</function></member>
   <member><xref linkend="mongodb.tutorial.apm" /></member>
  </simplelist>
 </refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
