]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1914] Interface for the async receives
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 16 May 2012 13:23:02 +0000 (15:23 +0200)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Wed, 16 May 2012 13:23:02 +0000 (15:23 +0200)
It needs to be tested, documented and of course implemented.

src/lib/config/ccsession.h

index 059968c71a311c2b92ee42639346adda0df884b4..4b089e99e417b2cf1d8718257250c9a6bc96fd12 100644 (file)
 #ifndef __CCSESSION_H
 #define __CCSESSION_H 1
 
-#include <string>
-
 #include <config/config_data.h>
 #include <config/module_spec.h>
+
 #include <cc/session.h>
 #include <cc/data.h>
 
+#include <string>
+#include <list>
+#include <boost/function.hpp>
+
 namespace isc {
 namespace config {
 
@@ -358,6 +361,20 @@ public:
         return (session_.group_recvmsg(envelope, msg, nonblock, seq));
     };
 
+    class AsyncRecvRequest;
+    typedef std::list<boost::shared_ptr<AsyncRecvRequest> > AsyncRecvRequests;
+    typedef AsyncRecvRequests::const_iterator AsyncRecvRequestID;
+    typedef boost::function3<void, const isc::data::ConstElementPtr&,
+                             const isc::data::ConstElementPtr&,
+                             const AsyncRecvRequestID&>
+        AsyncRecvCallback;
+    AsyncRecvRequestID groupRecvMsgAsync(const AsyncRecvCallback& callback,
+                                         bool is_reply = true, int seq = -1,
+                                         const std::string& recipient =
+                                         std::string());
+
+    void cancelAsyncRecv(const AsyncRecvRequestID& id);
+
 private:
     ModuleSpec readModuleSpecification(const std::string& filename);
     void startCheck();
@@ -367,6 +384,7 @@ private:
     std::string module_name_;
     isc::cc::AbstractSession& session_;
     ModuleSpec module_specification_;
+    AsyncRecvRequests async_recv_requests_;
     isc::data::ConstElementPtr handleConfigUpdate(
         isc::data::ConstElementPtr new_config);