Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
cluster::ClusterCommunicationService Class Reference

Service to post and read messages to/from the cluster. It uses a backend to communicate with the cluster. More...

#include <ClusterCommunicationService.hpp>

Inheritance diagram for cluster::ClusterCommunicationService:
Collaboration diagram for cluster::ClusterCommunicationService:

Public Member Functions

 ClusterCommunicationService (std::shared_ptr< data::BackendInterface > backend, std::chrono::steady_clock::duration readInterval=kDEFAULT_READ_INTERVAL, std::chrono::steady_clock::duration writeInterval=kDEFAULT_WRITE_INTERVAL)
 Construct a new Cluster Communication Service object.
 
void run ()
 Start the service.
 
void stop ()
 Stop the service.
 
 ClusterCommunicationService (ClusterCommunicationService &&)=delete
 
 ClusterCommunicationService (ClusterCommunicationService const &)=delete
 
ClusterCommunicationServiceoperator= (ClusterCommunicationService &&)=delete
 
ClusterCommunicationServiceoperator= (ClusterCommunicationService const &)=delete
 
std::shared_ptr< boost::uuids::uuid > selfUuid () const
 Get the UUID of the current node.
 
ClioNode selfData () const override
 Get the data of the current node.
 
std::vector< ClioNodeclusterData () const override
 Get the data of all nodes in the cluster (including self).
 
- Public Member Functions inherited from cluster::ClusterCommunicationServiceInterface

Static Public Attributes

static constexpr std::chrono::milliseconds kDEFAULT_READ_INTERVAL {2100}
 
static constexpr std::chrono::milliseconds kDEFAULT_WRITE_INTERVAL {1200}
 

Detailed Description

Service to post and read messages to/from the cluster. It uses a backend to communicate with the cluster.

Constructor & Destructor Documentation

◆ ClusterCommunicationService()

cluster::ClusterCommunicationService::ClusterCommunicationService ( std::shared_ptr< data::BackendInterface > backend,
std::chrono::steady_clock::duration readInterval = kDEFAULT_READ_INTERVAL,
std::chrono::steady_clock::duration writeInterval = kDEFAULT_WRITE_INTERVAL )

Construct a new Cluster Communication Service object.

Parameters
backendThe backend to use for communication.
readIntervalThe interval to read messages from the cluster.
writeIntervalThe interval to write messages to the cluster.

Member Function Documentation

◆ clusterData()

std::vector< ClioNode > cluster::ClusterCommunicationService::clusterData ( ) const
overridevirtual

Get the data of all nodes in the cluster (including self).

Returns
The data of all nodes in the cluster.

Implements cluster::ClusterCommunicationServiceInterface.

◆ selfData()

ClioNode cluster::ClusterCommunicationService::selfData ( ) const
overridevirtual

Get the data of the current node.

Returns
The data of the current node.

Implements cluster::ClusterCommunicationServiceInterface.

◆ selfUuid()

std::shared_ptr< boost::uuids::uuid > cluster::ClusterCommunicationService::selfUuid ( ) const

Get the UUID of the current node.

Returns
The UUID of the current node.

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