22#include "feed/Types.hpp"
23#include "feed/impl/TrackableSignal.hpp"
24#include "feed/impl/TrackableSignalMap.hpp"
25#include "feed/impl/Util.hpp"
26#include "util/async/AnyExecutionContext.hpp"
27#include "util/async/AnyStrand.hpp"
28#include "util/log/Logger.hpp"
29#include "util/prometheus/Gauge.hpp"
31#include <boost/asio/io_context.hpp>
32#include <boost/asio/strand.hpp>
33#include <boost/json/object.hpp>
35#include <xrpl/protocol/AccountID.h>
36#include <xrpl/protocol/Book.h>
37#include <xrpl/protocol/LedgerHeader.h>
43#include <unordered_set>
54 std::unordered_set<SubscriberPtr>
57 std::reference_wrapper<util::prometheus::GaugeInt> subAllCount_;
58 std::reference_wrapper<util::prometheus::GaugeInt> subAccountCount_;
69 : strand_(executionCtx.makeStrand())
70 , subAllCount_(getSubscriptionsGaugeInt(
"tx_proposed"))
71 , subAccountCount_(getSubscriptionsGaugeInt(
"account_proposed"))
81 sub(SubscriberSharedPtr
const& subscriber);
89 sub(ripple::AccountID
const& account, SubscriberSharedPtr
const& subscriber);
96 unsub(SubscriberSharedPtr
const& subscriber);
104 unsub(ripple::AccountID
const& account, SubscriberSharedPtr
const& subscriber);
111 pub(boost::json::object
const& receivedTxJson);
130 unsubInternal(ripple::AccountID
const& account,
SubscriberPtr subscriber);
Feed that publishes the Proposed Transactions.
Definition ProposedTransactionFeed.hpp:51
std::uint64_t accountSubCount() const
Get the number of accounts subscribers.
Definition ProposedTransactionFeed.cpp:122
std::uint64_t transactionSubcount() const
Get the number of subscribers of the proposed transaction feed.
Definition ProposedTransactionFeed.cpp:116
ProposedTransactionFeed(util::async::AnyExecutionContext &executionCtx)
Construct a Proposed Transaction Feed object.
Definition ProposedTransactionFeed.hpp:68
void sub(SubscriberSharedPtr const &subscriber)
Subscribe to the proposed transaction feed.
Definition ProposedTransactionFeed.cpp:39
void unsub(SubscriberSharedPtr const &subscriber)
Unsubscribe to the proposed transaction feed.
Definition ProposedTransactionFeed.cpp:81
void pub(boost::json::object const &receivedTxJson)
Publishes the proposed transaction feed.
Definition ProposedTransactionFeed.cpp:93
Class to manage a map of key and its associative signal.
Definition TrackableSignalMap.hpp:49
A thread-safe class to manage a signal and its tracking connections.
Definition TrackableSignal.hpp:44
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:110
A type-erased execution context.
Definition AnyExecutionContext.hpp:41
A type-erased execution context.
Definition AnyStrand.hpp:40
An interface to provide connection functionality for subscriptions.
Definition SubscriptionContextInterface.hpp:39