Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
etl::LedgerPublisherInterface Struct Referenceabstract

The interface of a scheduler for the extraction process. More...

#include <LedgerPublisherInterface.hpp>

Inheritance diagram for etl::LedgerPublisherInterface:

Public Member Functions

virtual bool publish (uint32_t seq, std::optional< uint32_t > maxAttempts, std::chrono::steady_clock::duration attemptsDelay=std::chrono::seconds{1})=0
 Publish the ledger by its sequence number.
virtual std::chrono::time_point< std::chrono::system_clock > getLastPublish () const =0
 Get last publish time as a time point.
virtual std::uint32_t lastCloseAgeSeconds () const =0
 Get time passed since last ledger close, in seconds.
virtual std::uint32_t lastPublishAgeSeconds () const =0
 Get time passed since last publish, in seconds.
virtual void stop ()=0
 Stop publishing.

Detailed Description

The interface of a scheduler for the extraction process.

Member Function Documentation

◆ getLastPublish()

virtual std::chrono::time_point< std::chrono::system_clock > etl::LedgerPublisherInterface::getLastPublish ( ) const
nodiscardpure virtual

Get last publish time as a time point.

Returns
A std::chrono::time_point representing the time of the last publish

Implemented in etl::impl::LedgerPublisher.

◆ lastCloseAgeSeconds()

virtual std::uint32_t etl::LedgerPublisherInterface::lastCloseAgeSeconds ( ) const
nodiscardpure virtual

Get time passed since last ledger close, in seconds.

Returns
The number of seconds since the last ledger close as std::uint32_t

Implemented in etl::impl::LedgerPublisher.

◆ lastPublishAgeSeconds()

virtual std::uint32_t etl::LedgerPublisherInterface::lastPublishAgeSeconds ( ) const
nodiscardpure virtual

Get time passed since last publish, in seconds.

Returns
The number of seconds since the last publish as std::uint32_t

Implemented in etl::impl::LedgerPublisher.

◆ publish()

virtual bool etl::LedgerPublisherInterface::publish ( uint32_t seq,
std::optional< uint32_t > maxAttempts,
std::chrono::steady_clock::duration attemptsDelay = std::chrono::seconds{1} )
pure virtual

Publish the ledger by its sequence number.

Parameters
seqThe sequence number of the ledger
maxAttemptsThe maximum number of attempts to publish the ledger; no limit if nullopt
attemptsDelayThe delay between attempts
Returns
Whether the ledger was found in the database and published

Implemented in etl::impl::LedgerPublisher.

◆ stop()

virtual void etl::LedgerPublisherInterface::stop ( )
pure virtual

Stop publishing.

Makes any ongoing or future publish(seq, ...) call stop waiting for the ledger to appear in the database and return false. Stopping is permanent.

Implemented in etl::impl::LedgerPublisher.


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