BIND 10 trac2932, updated. 2093c5f82308d58537cb01130a2e54109cfbd6d7 [2932] Document the notification interface

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Sep 6 07:11:15 UTC 2013


The branch, trac2932 has been updated
       via  2093c5f82308d58537cb01130a2e54109cfbd6d7 (commit)
      from  d5d77acc2f46862e365fb42ae983158bd47eee9b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2093c5f82308d58537cb01130a2e54109cfbd6d7
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Fri Sep 6 08:51:15 2013 +0200

    [2932] Document the notification interface

-----------------------------------------------------------------------

Summary of changes:
 src/lib/config/ccsession.h |   38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

-----------------------------------------------------------------------
diff --git a/src/lib/config/ccsession.h b/src/lib/config/ccsession.h
index 5f17ff2..75c3ee6 100644
--- a/src/lib/config/ccsession.h
+++ b/src/lib/config/ccsession.h
@@ -575,17 +575,55 @@ public:
     /// \param id The id of request as returned by groupRecvMsgAsync.
     void cancelAsyncRecv(const AsyncRecvRequestID& id);
 
+    /// \brief Called when a notification comes
+    ///
+    /// The callback should be exception-free. If it raises an exception,
+    /// it'll leak through the event loop up and probably terminate the
+    /// application.
+    ///
+    /// \param event_name The identification of event type.
+    /// \param params The parameters of the event. This may be NULL
+    ///     pointer in case no parameters were sent with the event.
     typedef boost::function<void (const std::string& event_name,
                                   const data::ConstElementPtr& params)>
         NotificationCallback;
+
+    /// \brief Multiple notification callbacks for the same notification
     typedef std::list<NotificationCallback> NotificationCallbacks;
+
+    /// \brief Mapping from groups to callbacks
     typedef std::map<std::string, NotificationCallbacks>
         SubscribedNotifications;
+
+    /// \brief Identification of single callback
     typedef std::pair<SubscribedNotifications::iterator,
                       NotificationCallbacks::iterator>
         NotificationID;
+
+    /// \brief Subscribe to a notification group
+    ///
+    /// From now on, every notification that is sent to the given group
+    /// triggers the passed callback.
+    ///
+    /// There may be multiple (independent) callbacks for the same channel.
+    /// This one adds a new one, to the end of the chain (the callbacks
+    /// are called in the same order as they were registered).
+    ///
+    /// \param notification_group The channel of notifications.
+    /// \param callback The callback to be added.
+    /// \return ID of the notification callback. It is an opaque ID and can
+    ///     be used to remove this callback.
     NotificationID subscribeNotification(const std::string& notification_group,
                                          const NotificationCallback& callback);
+
+    /// \brief Unsubscribe the callback from its notification group.
+    ///
+    /// Express that the desire for this callback to be executed is no longer
+    /// relevant. All the other callbacks (even for the same notification
+    /// group) are left intact.
+    ///
+    /// \param notification The ID of notification callback returned by
+    ///     subscribeNotification.
     void unsubscribeNotification(const NotificationID& notification);
 
     /// \brief Subscribe to a group



More information about the bind10-changes mailing list