aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/events.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 09:50:18 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-26 09:50:18 +0100
commit93a26608132961f13f868ee80a71fbb2b1ed1cbc (patch)
tree29c7a9210d37e17cda189a64c653d025f30ce6c2 /src/libserver/events.h
parent1abb0939d17211cadd1be7b7249cf024f8cfebdf (diff)
downloadrspamd-93a26608132961f13f868ee80a71fbb2b1ed1cbc.tar.gz
rspamd-93a26608132961f13f868ee80a71fbb2b1ed1cbc.zip
Impelement concept of watched events.
Diffstat (limited to 'src/libserver/events.h')
-rw-r--r--src/libserver/events.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libserver/events.h b/src/libserver/events.h
index 442834f98..5f5d509ef 100644
--- a/src/libserver/events.h
+++ b/src/libserver/events.h
@@ -81,4 +81,23 @@ gboolean destroy_session (struct rspamd_async_session *session);
*/
gboolean check_session_pending (struct rspamd_async_session *session);
+/**
+ * Start watching for events in the session, so the specified watcher will be added
+ * to all subsequent events until `rspamd_session_watch_stop` is called
+ * @param s session object
+ * @param cb watcher callback that is called when all events watched are destroyed
+ * @param ud opaque data for the callback
+ */
+void rspamd_session_watch_start (struct rspamd_async_session *s,
+ event_watcher_t cb,
+ gpointer ud);
+
+/**
+ * Stop watching mode, if no events are watched since the last `rspamd_session_watch_start`,
+ * then the watcher is silently ignored
+ * @param s session
+ * @return number of events watched
+ */
+guint rspamd_session_watch_stop (struct rspamd_async_session *s);
+
#endif /* RSPAMD_EVENTS_H */