CatapultServer  v0.5.0.1 (Elephant)
catapult::chain::RemoteApiForwarder Class Reference

Simplifies interacting with remote nodes via apis. More...

Collaboration diagram for catapult::chain::RemoteApiForwarder:

Public Member Functions

 RemoteApiForwarder (net::PacketIoPicker &packetIoPicker, const model::TransactionRegistry &transactionRegistry, const utils::TimeSpan &timeout, const std::string &operationName)
 
template<typename TRemoteApiAction , typename TRemoteApiFactory >
thread::future< ionet::NodeInteractionResultprocessSync (TRemoteApiAction action, TRemoteApiFactory apiFactory) const
 Picks a random peer and wraps an api around it using apiFactory. Finally, passes the api to action. More...
 

Private Attributes

net::PacketIoPickerm_packetIoPicker
 
const model::TransactionRegistrym_transactionRegistry
 
utils::TimeSpan m_timeout
 
std::string m_operationName
 

Detailed Description

Simplifies interacting with remote nodes via apis.

Constructor & Destructor Documentation

◆ RemoteApiForwarder()

catapult::chain::RemoteApiForwarder::RemoteApiForwarder ( net::PacketIoPicker packetIoPicker,
const model::TransactionRegistry transactionRegistry,
const utils::TimeSpan timeout,
const std::string &  operationName 
)
inline

Creates a forwarder around a peer selector (packetIoPicker) with a connection timeout given a transaction registry (transactionRegistry) and a friendly name (operationName).

Member Function Documentation

◆ processSync()

template<typename TRemoteApiAction , typename TRemoteApiFactory >
thread::future<ionet::NodeInteractionResult> catapult::chain::RemoteApiForwarder::processSync ( TRemoteApiAction  action,
TRemoteApiFactory  apiFactory 
) const
inline

Picks a random peer and wraps an api around it using apiFactory. Finally, passes the api to action.

Here is the call graph for this function:

Member Data Documentation

◆ m_operationName

std::string catapult::chain::RemoteApiForwarder::m_operationName
private

◆ m_packetIoPicker

net::PacketIoPicker& catapult::chain::RemoteApiForwarder::m_packetIoPicker
private

◆ m_timeout

utils::TimeSpan catapult::chain::RemoteApiForwarder::m_timeout
private

◆ m_transactionRegistry

const model::TransactionRegistry& catapult::chain::RemoteApiForwarder::m_transactionRegistry
private

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