From 41aa1ed41d0779be263f5f0ef21a999a6f9154c0 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 13 Aug 2021 22:35:13 +0200 Subject: -add support for event notifications to exchangedb plugin --- src/include/taler_exchangedb_plugin.h | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/include') diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 1eab06fc8..61c764a53 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -2145,6 +2145,52 @@ struct TALER_EXCHANGEDB_Plugin struct TALER_EXCHANGEDB_Session *session); + /** + * 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 -- cgit v1.2.3