Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
feed::impl::LedgerFeed Class Reference

Feed that publishes the ledger info. Example : {'type': 'ledgerClosed', 'ledger_index': 2647935, 'ledger_hash': '5D022718CD782A82EE10D2147FD90B5F42F26A7E937C870B4FE3CF1086C916AE', 'ledger_time': 756395681, 'fee_base': 10, 'reserve_base': 10000000, 'reserve_inc': 2000000, 'validated_ledgers': '2619127-2647935', 'txn_count': 0, 'network_id': 1}. More...

#include <LedgerFeed.hpp>

Inheritance diagram for feed::impl::LedgerFeed:
Collaboration diagram for feed::impl::LedgerFeed:

Public Member Functions

 LedgerFeed (util::async::AnyExecutionContext &executionCtx)
 Construct a new Ledger Feed object.
boost::json::object sub (boost::asio::yield_context yield, std::shared_ptr< data::BackendInterface const > const &backend, SubscriberSharedPtr const &subscriber, uint32_t networkID)
 Subscribe the ledger feed.
void pub (ripple::LedgerHeader const &lgrInfo, ripple::Fees const &fees, std::string const &ledgerRange, uint32_t txnCount, uint32_t networkID)
 Publishes the ledger feed.
Public Member Functions inherited from feed::impl::SingleFeedBase
 SingleFeedBase (util::async::AnyExecutionContext &executionCtx, std::string const &name)
 Construct a new Single Feed Base object.
void sub (SubscriberSharedPtr const &subscriber)
 Subscribe the feed.
void unsub (SubscriberSharedPtr const &subscriber)
 Unsubscribe the feed.
void pub (std::string msg)
 Publishes the feed in strand.
std::uint64_t count () const
 Get the count of subscribers.

Detailed Description

Feed that publishes the ledger info. Example : {'type': 'ledgerClosed', 'ledger_index': 2647935, 'ledger_hash': '5D022718CD782A82EE10D2147FD90B5F42F26A7E937C870B4FE3CF1086C916AE', 'ledger_time': 756395681, 'fee_base': 10, 'reserve_base': 10000000, 'reserve_inc': 2000000, 'validated_ledgers': '2619127-2647935', 'txn_count': 0, 'network_id': 1}.

Constructor & Destructor Documentation

◆ LedgerFeed()

feed::impl::LedgerFeed::LedgerFeed ( util::async::AnyExecutionContext & executionCtx)
inline

Construct a new Ledger Feed object.

Parameters
executionCtxThe actual publish will be called in the strand of this.

Member Function Documentation

◆ pub()

void feed::impl::LedgerFeed::pub ( ripple::LedgerHeader const & lgrInfo,
ripple::Fees const & fees,
std::string const & ledgerRange,
uint32_t txnCount,
uint32_t networkID )

Publishes the ledger feed.

Parameters
lgrInfoThe ledger header.
feesThe fees.
ledgerRangeThe ledger range.
txnCountThe transaction count.
networkIDThe network ID.

◆ sub()

boost::json::object feed::impl::LedgerFeed::sub ( boost::asio::yield_context yield,
std::shared_ptr< data::BackendInterface const > const & backend,
SubscriberSharedPtr const & subscriber,
uint32_t networkID )

Subscribe the ledger feed.

Parameters
yieldThe coroutine yield.
backendThe backend.
subscriberThe subscriber.
networkIDThe network ID.
Returns
The information of the latest ledger.

The documentation for this class was generated from the following files:
  • /__w/clio/clio/src/feed/impl/LedgerFeed.hpp
  • /__w/clio/clio/src/feed/impl/LedgerFeed.cpp