OpenCBDC Transaction Processor
|
Interface for a coordinator. More...
#include <interface.hpp>
Public Types | |
using | callback_type = std::function<void(std::optional<bool>)> |
Signature of callback function for a transaction execution result. | |
Public Member Functions | |
virtual | ~interface ()=default |
interface ()=default | |
interface (const interface &)=delete | |
auto | operator= (const interface &) -> interface &=delete |
interface (interface &&)=delete | |
auto | operator= (interface &&) -> interface &=delete |
virtual auto | execute_transaction (transaction::compact_tx tx, callback_type result_callback) -> bool=0 |
Execute the given compact transaction. | |
Interface for a coordinator.
Provides consistent semantics whether using a remote coordinator via an RPC client, or a local implementation directly. An RPC server can use this interface to handle requests without knowing how the interface is implemented. Allows for easier mocking in test suites and swapping implementations without changing dependent components.
Definition at line 20 of file uhs/twophase/coordinator/interface.hpp.
using cbdc::coordinator::interface::callback_type = std::function<void(std::optional<bool>)> |
Signature of callback function for a transaction execution result.
Definition at line 30 of file uhs/twophase/coordinator/interface.hpp.
|
virtualdefault |
|
default |
|
delete |
|
delete |
|
pure virtual |
Execute the given compact transaction.
An RPC client subclass would send a request to a remote coordinator and wait for the response. A coordinator implementation would coordinate the transaction between locking shards and return the execution result.
tx | transaction to execute. |
result_callback | function to call when the transaction has executed to completion or failed. |
Implemented in cbdc::coordinator::controller, and cbdc::coordinator::rpc::client.
Referenced by cbdc::coordinator::rpc::server::server().