Clio develop
The XRP Ledger API server.
|
A subscription manager is responsible for managing the subscriptions and publishing the feeds. More...
#include <SubscriptionManager.hpp>
Public Member Functions | |
SubscriptionManager (util::async::AnyExecutionContext &&executor, std::shared_ptr< data::BackendInterface const > const &backend) | |
Construct a new Subscription Manager object. | |
~SubscriptionManager () override | |
Destructor of the SubscriptionManager object. It will block until all running jobs finished. | |
void | stop () override |
Stop the SubscriptionManager and wait for all jobs to finish. | |
void | subBookChanges (SubscriberSharedPtr const &subscriber) final |
Subscribe to the book changes feed. | |
void | unsubBookChanges (SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the book changes feed. | |
void | pubBookChanges (ripple::LedgerHeader const &lgrInfo, std::vector< data::TransactionAndMetadata > const &transactions) final |
Publish the book changes feed. | |
void | subProposedTransactions (SubscriberSharedPtr const &subscriber) final |
Subscribe to the proposed transactions feed. | |
void | unsubProposedTransactions (SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the proposed transactions feed. | |
void | subProposedAccount (ripple::AccountID const &account, SubscriberSharedPtr const &subscriber) final |
Subscribe to the proposed transactions feed, only receive the feed when particular account is affected. | |
void | unsubProposedAccount (ripple::AccountID const &account, SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the proposed transactions feed for particular account. | |
void | forwardProposedTransaction (boost::json::object const &receivedTxJson) final |
Forward the proposed transactions feed. | |
boost::json::object | subLedger (boost::asio::yield_context yield, SubscriberSharedPtr const &subscriber) final |
Subscribe to the ledger feed. | |
void | unsubLedger (SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the ledger feed. | |
void | pubLedger (ripple::LedgerHeader const &lgrInfo, ripple::Fees const &fees, std::string const &ledgerRange, std::uint32_t txnCount) final |
Publish the ledger feed. | |
void | subManifest (SubscriberSharedPtr const &subscriber) final |
Subscribe to the manifest feed. | |
void | unsubManifest (SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the manifest feed. | |
void | forwardManifest (boost::json::object const &manifestJson) final |
Forward the manifest feed. | |
void | subValidation (SubscriberSharedPtr const &subscriber) final |
Subscribe to the validation feed. | |
void | unsubValidation (SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the validation feed. | |
void | forwardValidation (boost::json::object const &validationJson) final |
Forward the validation feed. | |
void | subTransactions (SubscriberSharedPtr const &subscriber) final |
Subscribe to the transactions feed. | |
void | unsubTransactions (SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the transactions feed. | |
void | subAccount (ripple::AccountID const &account, SubscriberSharedPtr const &subscriber) final |
Subscribe to the transactions feed, only receive the feed when particular account is affected. | |
void | unsubAccount (ripple::AccountID const &account, SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the transactions feed for particular account. | |
void | subBook (ripple::Book const &book, SubscriberSharedPtr const &subscriber) final |
Subscribe to the transactions feed, only receive feed when particular order book is affected. | |
void | unsubBook (ripple::Book const &book, SubscriberSharedPtr const &subscriber) final |
Unsubscribe to the transactions feed for particular order book. | |
void | pubTransaction (data::TransactionAndMetadata const &txMeta, ripple::LedgerHeader const &lgrInfo) final |
Forward the transactions feed. | |
boost::json::object | report () const final |
Get the number of subscribers. | |
![]() |
Static Public Member Functions | |
static std::shared_ptr< SubscriptionManager > | makeSubscriptionManager (util::config::ClioConfigDefinition const &config, std::shared_ptr< data::BackendInterface const > const &backend) |
Factory function to create a new SubscriptionManager with a PoolExecutionContext. | |
A subscription manager is responsible for managing the subscriptions and publishing the feeds.
|
inline |
Construct a new Subscription Manager object.
executor | The executor to use to publish the feeds |
backend | The backend to use |
|
finalvirtual |
Forward the manifest feed.
manifestJson | The manifest json to forward. |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Forward the proposed transactions feed.
receivedTxJson | The proposed transaction json. |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Forward the validation feed.
validationJson | The validation feed json to forward. |
Implements feed::SubscriptionManagerInterface.
|
inlinestatic |
Factory function to create a new SubscriptionManager with a PoolExecutionContext.
config | The configuration to use |
backend | The backend to use |
|
finalvirtual |
Publish the book changes feed.
lgrInfo | The current ledger header. |
transactions | The transactions in the current ledger. |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Publish the ledger feed.
lgrInfo | The ledger header. |
fees | The fees. |
ledgerRange | The ledger range. |
txnCount | The transaction count. |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Forward the transactions feed.
txMeta | The transaction and metadata. |
lgrInfo | The ledger header. |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Get the number of subscribers.
Implements feed::SubscriptionManagerInterface.
|
inlineoverridevirtual |
Stop the SubscriptionManager and wait for all jobs to finish.
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the transactions feed, only receive the feed when particular account is affected.
account | The account to watch. |
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the transactions feed, only receive feed when particular order book is affected.
book | The book to watch. |
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the book changes feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the ledger feed.
yield | The coroutine context |
subscriber | The subscriber to the ledger feed |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the manifest feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the proposed transactions feed, only receive the feed when particular account is affected.
account | The account to watch. |
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the proposed transactions feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the transactions feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Subscribe to the validation feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the transactions feed for particular account.
account | The account to stop watching |
subscriber | The subscriber to unsubscribe |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the transactions feed for particular order book.
book | The book to watch. |
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the book changes feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the ledger feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the manifest feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the proposed transactions feed for particular account.
account | The account to stop watching. |
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the proposed transactions feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the transactions feed.
subscriber |
Implements feed::SubscriptionManagerInterface.
|
finalvirtual |
Unsubscribe to the validation feed.
subscriber |
Implements feed::SubscriptionManagerInterface.