OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::coordinator::rpc::client Class Reference

RPC client for a coordinator. More...

#include <client.hpp>

Inheritance diagram for cbdc::coordinator::rpc::client:
Collaboration diagram for cbdc::coordinator::rpc::client:

Public Member Functions

 client (std::vector< network::endpoint_t > endpoints)
 Constructor.
 
 client ()=delete
 
 ~client () override=default
 
 client (const client &)=delete
 
auto operator= (const client &) -> client &=delete
 
 client (client &&)=delete
 
auto operator= (client &&) -> client &=delete
 
auto init () -> bool
 Initializes the RPC client by connecting to the coordinator cluster and starting a response handler thread.
 
auto execute_transaction (transaction::compact_tx tx, callback_type result_callback) -> bool override
 Requests execution of the given transaction using the coordinator cluster.
 
- Public Member Functions inherited from cbdc::coordinator::interface
virtual ~interface ()=default
 
 interface ()=default
 
 interface (const interface &)=delete
 
auto operator= (const interface &) -> interface &=delete
 
 interface (interface &&)=delete
 
auto operator= (interface &&) -> interface &=delete
 

Additional Inherited Members

- Public Types inherited from cbdc::coordinator::interface
using callback_type = std::function<void(std::optional<bool>)>
 Signature of callback function for a transaction execution result.
 

Detailed Description

RPC client for a coordinator.

Definition at line 15 of file uhs/twophase/coordinator/client.hpp.

Constructor & Destructor Documentation

◆ client() [1/4]

cbdc::coordinator::rpc::client::client ( std::vector< network::endpoint_t > endpoints)
explicit

Constructor.

Parameters
endpointsRPC server endpoints for the coordinator cluster.

Definition at line 11 of file uhs/twophase/coordinator/client.cpp.

◆ client() [2/4]

cbdc::coordinator::rpc::client::client ( )
delete

◆ ~client()

cbdc::coordinator::rpc::client::~client ( )
overridedefault

◆ client() [3/4]

cbdc::coordinator::rpc::client::client ( const client & )
delete

◆ client() [4/4]

cbdc::coordinator::rpc::client::client ( client && )
delete

Member Function Documentation

◆ execute_transaction()

auto cbdc::coordinator::rpc::client::execute_transaction ( transaction::compact_tx tx,
callback_type result_callback ) -> bool
overridevirtual

Requests execution of the given transaction using the coordinator cluster.

See also
interface::execute_transaction.
Parameters
txtransaction to execution.
result_callbackfunction to call when execution result is available.
Returns
true if the RPC request was sent to the cluster successfully.

Implements cbdc::coordinator::interface.

Definition at line 19 of file uhs/twophase/coordinator/client.cpp.

◆ init()

auto cbdc::coordinator::rpc::client::init ( ) -> bool

Initializes the RPC client by connecting to the coordinator cluster and starting a response handler thread.

Returns
false if there is only one coordinator endpoint and connecting to it failed. Otherwise true.

Definition at line 15 of file uhs/twophase/coordinator/client.cpp.

◆ operator=() [1/2]

auto cbdc::coordinator::rpc::client::operator= ( client && ) -> client &=delete
delete

◆ operator=() [2/2]

auto cbdc::coordinator::rpc::client::operator= ( const client & ) -> client &=delete
delete

The documentation for this class was generated from the following files: