ctdb-common: Add async version of shutdown in sock_daemon
[samba.git] / ctdb / common / sock_daemon.h
index 2cc94c6bf5dd38d5de9dcf0d8871d9de74e0b2e6..a071833c2f382c43f5b9e2d9f41d1f6f9e39e259 100644 (file)
@@ -63,6 +63,12 @@ struct sock_client_context;
  * shutdown() is called when process receives SIGINT or SIGTERM or
  *             when wait computation has finished
  *
+ * shutdown_send()/shutdown_recv() is the async version of shutdown()
+ *
+ * Please note that only one (sync or async) version of these functions
+ * will be called.  If both versions are defined, then only async function
+ * will be called.
+ *
  * wait_send() starts the async computation to keep running the daemon
  * wait_recv() ends the async computation to keep running the daemon
  *
@@ -86,6 +92,11 @@ struct sock_daemon_funcs {
 
        void (*shutdown)(void *private_data);
 
+       struct tevent_req * (*shutdown_send)(TALLOC_CTX *mem_ctx,
+                                            struct tevent_context *ev,
+                                            void *private_data);
+       void (*shutdown_recv)(struct tevent_req *req);
+
        struct tevent_req * (*wait_send)(TALLOC_CTX *mem_ctx,
                                         struct tevent_context *ev,
                                         void *private_data);