summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-08-13 22:35:13 +0200
committerChristian Grothoff <christian@grothoff.org>2021-08-13 22:35:13 +0200
commit41aa1ed41d0779be263f5f0ef21a999a6f9154c0 (patch)
treeeda484ab6d1adfed23aa088b709e9c76556583c4 /src/include
parent756998a6d57dcb1ef310be326b22379caf3030d0 (diff)
downloadexchange-41aa1ed41d0779be263f5f0ef21a999a6f9154c0.tar.gz
exchange-41aa1ed41d0779be263f5f0ef21a999a6f9154c0.tar.bz2
exchange-41aa1ed41d0779be263f5f0ef21a999a6f9154c0.zip
-add support for event notifications to exchangedb plugin
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchangedb_plugin.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 1eab06fc..61c764a5 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -2146,6 +2146,52 @@ struct TALER_EXCHANGEDB_Plugin
/**
+ * Register callback to be invoked on events of type @a es.
+ *
+ * @param cls database context to use
+ * @param session connection to use
+ * @param es specification of the event to listen for
+ * @param cb function to call when the event happens, possibly
+ * multiple times (until cancel is invoked)
+ * @param cb_cls closure for @a cb
+ * @return handle useful to cancel the listener
+ */
+ struct GNUNET_DB_EventHandler *
+ (*event_listen)(void *cls,
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct GNUNET_DB_EventHeaderP *es,
+ GNUNET_DB_EventCallback cb,
+ void *cb_cls);
+
+ /**
+ * Stop notifications.
+ *
+ * @param cls database context to use
+ * @param eh handle to unregister.
+ */
+ void
+ (*event_listen_cancel)(void *cls,
+ struct GNUNET_DB_EventHandler *eh);
+
+
+ /**
+ * Notify all that listen on @a es of an event.
+ *
+ * @param cls database context to use
+ * @param session connection to use
+ * @param es specification of the event to generate
+ * @param extra additional event data provided
+ * @param extra_size number of bytes in @a extra
+ */
+ void
+ (*event_notify)(void *cls,
+ struct TALER_EXCHANGEDB_Session *session,
+ const struct GNUNET_DB_EventHeaderP *es,
+ const void *extra,
+ size_t extra_size);
+
+
+ /**
* Insert information about a denomination key and in particular
* the properties (value, fees, expiration times) the coins signed
* with this key have.