getting aggregator structure laid out for #4141
This commit is contained in:
parent
57c1d2318f
commit
bd3700e608
@ -618,6 +618,19 @@ typedef void
|
||||
const struct TALER_Amount *transfer_value);
|
||||
|
||||
|
||||
/**
|
||||
* Callback with data about a prepared transaction.
|
||||
*
|
||||
* @param cls closure
|
||||
* @param buf transaction data that was persisted, NULL on error
|
||||
* @param buf_size number of bytes in @a buf, 0 on error
|
||||
*/
|
||||
typedef void
|
||||
(*TALER_MINTDB_WirePreparationCallback) (void *cls,
|
||||
const char *buf,
|
||||
size_t buf_size);
|
||||
|
||||
|
||||
/**
|
||||
* @brief The plugin API, returned from the plugin's "init" function.
|
||||
* The argument given to "init" is simply a configuration handle.
|
||||
@ -1308,7 +1321,66 @@ struct TALER_MINTDB_Plugin
|
||||
const struct TALER_Amount *transfer_value);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Function called to insert wire transfer commit data into the DB.
|
||||
*
|
||||
* @param cls closure
|
||||
* @param session database connection
|
||||
* @param type type fo the wire transfer (i.e. "sepa")
|
||||
* @param buf buffer with wire transfer preparation data
|
||||
* @param buf_size number of bytes in @a buf
|
||||
* @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors
|
||||
*/
|
||||
int
|
||||
(*wire_prepare_data_insert)(void *cls,
|
||||
struct TALER_MINTDB_Session *session,
|
||||
const char *type,
|
||||
const char *buf,
|
||||
size_t buf_size);
|
||||
|
||||
|
||||
/**
|
||||
* Function called to mark wire transfer commit data as finished.
|
||||
*
|
||||
* @param cls closure
|
||||
* @param session database connection
|
||||
* @param type type fo the wire transfer (i.e. "sepa")
|
||||
* @param buf buffer with wire transfer preparation data
|
||||
* @param buf_size number of bytes in @a buf
|
||||
* @return #GNUNET_OK on success, #GNUNET_SYSERR on DB errors
|
||||
*/
|
||||
int
|
||||
(*wire_prepare_data_mark_finished)(void *cls,
|
||||
struct TALER_MINTDB_Session *session,
|
||||
const char *type,
|
||||
const char *buf,
|
||||
size_t buf_size);
|
||||
|
||||
|
||||
/**
|
||||
* Function called to iterate over unfinished wire transfer
|
||||
* preparation data. Fetches at most one item.
|
||||
*
|
||||
* @param cls closure
|
||||
* @param session database connection
|
||||
* @param type type fo the wire transfer (i.e. "sepa")
|
||||
* @param cb function to call for ONE unfinished item
|
||||
* @param cb_cls closure for @a cb
|
||||
* @return #GNUNET_OK on success,
|
||||
* #GNUNET_NO if there are no entries,
|
||||
* #GNUNET_SYSERR on DB errors
|
||||
*/
|
||||
int
|
||||
(*wire_prepare_data_iterate)(void *cls,
|
||||
struct TALER_MINTDB_Session *session,
|
||||
const char *type,
|
||||
TALER_MINTDB_WirePreparationCallback cb,
|
||||
void *cb_cls);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* _NEURO_MINT_DB_H */
|
||||
#endif /* _TALER_MINT_DB_H */
|
||||
|
@ -220,9 +220,11 @@ run (void *cls,
|
||||
return;
|
||||
}
|
||||
/* FIXME: finish aggregate computation */
|
||||
/* FIXME: insert pre-commit data for transaction into DB */
|
||||
/* FIXME: mark transactions selected for aggregate as finished */
|
||||
/* wire_plugin->prepare_wire_transfer () -- ASYNC! */
|
||||
/* db_plugin->wire_prepare_data_insert () -- transactional! */
|
||||
/* db_plugin->XXX () -- mark transactions selected for aggregate as finished */
|
||||
|
||||
/* then finally: commit! */
|
||||
if (GNUNET_OK !=
|
||||
db_plugin->commit (db_plugin->cls,
|
||||
session))
|
||||
@ -231,12 +233,15 @@ run (void *cls,
|
||||
"Failed to commit database transaction!\n");
|
||||
}
|
||||
|
||||
/* FIXME: run 2nd transaction:
|
||||
- begin
|
||||
- select pre-commit data from DB
|
||||
- execute wire transfer
|
||||
- insert aggregation tracking information into DB
|
||||
- commit!
|
||||
/* While possible, run 2nd type of transaction:
|
||||
db_plugin->start()
|
||||
- select pre-commit data from DB:
|
||||
db_plugin->wire_prepare_data_iterate ()
|
||||
- execute wire transfer (successfully!)
|
||||
wire_plugin->execute_wire_transfer() # ASYNC!
|
||||
db_plugin->wire_prepare_data_mark_finished ()
|
||||
db_plugin->insert_aggregation_tracking ()
|
||||
db_plugin->commit()
|
||||
*/
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user