-add support for event notifications to exchangedb plugin

This commit is contained in:
Christian Grothoff 2021-08-13 22:35:13 +02:00
parent 756998a6d5
commit 41aa1ed41d
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 2601 additions and 2237 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2145,6 +2145,52 @@ struct TALER_EXCHANGEDB_Plugin
struct TALER_EXCHANGEDB_Session *session); 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 * Insert information about a denomination key and in particular
* the properties (value, fees, expiration times) the coins signed * the properties (value, fees, expiration times) the coins signed