OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::watchtower::async_client Class Reference

Client to asynchronously request information from the watchtower. More...

#include <client.hpp>

Public Types

using status_update_response_handler_t
 
using best_block_height_handler_t
 

Public Member Functions

 async_client ()=delete
 
 async_client (network::endpoint_t ep)
 Constructor.
 
 ~async_client ()
 
 async_client (const async_client &)=delete
 
auto operator= (const async_client &) -> async_client &=delete
 
 async_client (async_client &&)=delete
 
auto operator= (async_client &&) -> async_client &=delete
 
auto init () -> bool
 Attempts to connect to the watchtower.
 
void request_best_block_height ()
 Sends a request_best_block_height to the Watchtower.
 
void request_status_update (const status_update_request &req)
 Sends a StatusUpdateRequest to the Watchtower.
 
void set_status_update_handler (const status_update_response_handler_t &handler)
 Sets or replaces the handler for asynchronously delivered StatusUpdateResponses.
 
void set_block_height_handler (const best_block_height_handler_t &handler)
 Sets or replaces the handler for asynchronously delivered StatusUpdateResponses.
 

Detailed Description

Client to asynchronously request information from the watchtower.

Definition at line 61 of file uhs/atomizer/watchtower/client.hpp.

Member Typedef Documentation

◆ best_block_height_handler_t

Initial value:
std::function<void(
std::shared_ptr<best_block_height_response>&&)>

Definition at line 94 of file uhs/atomizer/watchtower/client.hpp.

◆ status_update_response_handler_t

Initial value:
std::function<void(
std::shared_ptr<status_request_check_success>&&)>

Definition at line 85 of file uhs/atomizer/watchtower/client.hpp.

Constructor & Destructor Documentation

◆ async_client() [1/4]

cbdc::watchtower::async_client::async_client ( )
delete

◆ async_client() [2/4]

cbdc::watchtower::async_client::async_client ( network::endpoint_t ep)
explicit

Constructor.

Parameters
epWatchtower endpoint.

Definition at line 73 of file uhs/atomizer/watchtower/client.cpp.

◆ ~async_client()

cbdc::watchtower::async_client::~async_client ( )

Definition at line 75 of file uhs/atomizer/watchtower/client.cpp.

References cbdc::network::connection_manager::close().

Here is the call graph for this function:

◆ async_client() [3/4]

cbdc::watchtower::async_client::async_client ( const async_client & )
delete

◆ async_client() [4/4]

cbdc::watchtower::async_client::async_client ( async_client && )
delete

Member Function Documentation

◆ init()

auto cbdc::watchtower::async_client::init ( ) -> bool

Attempts to connect to the watchtower.

Returns
true if the connection was successful.

Definition at line 85 of file uhs/atomizer/watchtower/client.cpp.

◆ operator=() [1/2]

auto cbdc::watchtower::async_client::operator= ( async_client && ) -> async_client &=delete
delete

◆ operator=() [2/2]

auto cbdc::watchtower::async_client::operator= ( const async_client & ) -> async_client &=delete
delete

◆ request_best_block_height()

void cbdc::watchtower::async_client::request_best_block_height ( )

Sends a request_best_block_height to the Watchtower.

Definition at line 130 of file uhs/atomizer/watchtower/client.cpp.

References cbdc::network::connection_manager::broadcast(), and cbdc::make_shared_buffer().

Here is the call graph for this function:

◆ request_status_update()

void cbdc::watchtower::async_client::request_status_update ( const status_update_request & req)

Sends a StatusUpdateRequest to the Watchtower.

Definition at line 137 of file uhs/atomizer/watchtower/client.cpp.

References cbdc::network::connection_manager::broadcast(), and cbdc::make_shared_buffer().

Here is the call graph for this function:

◆ set_block_height_handler()

void cbdc::watchtower::async_client::set_block_height_handler ( const best_block_height_handler_t & handler)

Sets or replaces the handler for asynchronously delivered StatusUpdateResponses.

Parameters
handlerthe handler function that the client should call whenever it receives a new StatusUpdateResponse.

Definition at line 148 of file uhs/atomizer/watchtower/client.cpp.

◆ set_status_update_handler()

void cbdc::watchtower::async_client::set_status_update_handler ( const status_update_response_handler_t & handler)

Sets or replaces the handler for asynchronously delivered StatusUpdateResponses.

Parameters
handlerthe handler function that the client should call whenever it receives a new StatusUpdateResponse.

Definition at line 143 of file uhs/atomizer/watchtower/client.cpp.


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