|
rippled
|
Listen to public/subscribe messages from a book. More...
#include <BookListeners.h>

Public Types | |
| using | pointer = std::shared_ptr< BookListeners > |
Public Member Functions | |
| BookListeners () | |
| void | addSubscriber (InfoSub::ref sub) |
| Add a new subscription for this book. | |
| void | removeSubscriber (std::uint64_t sub) |
| Stop publishing to a subscriber. | |
| void | publish (MultiApiJson const &jvObj, hash_set< std::uint64_t > &havePublished) |
| Publish a transaction to subscribers. | |
Private Attributes | |
| std::recursive_mutex | mLock |
| hash_map< std::uint64_t, InfoSub::wptr > | mListeners |
Listen to public/subscribe messages from a book.
Definition at line 14 of file BookListeners.h.
Definition at line 17 of file BookListeners.h.
| ripple::BookListeners::BookListeners | ( | ) |
Definition at line 19 of file BookListeners.h.
| void ripple::BookListeners::addSubscriber | ( | InfoSub::ref | sub | ) |
Add a new subscription for this book.
Definition at line 6 of file BookListeners.cpp.
| void ripple::BookListeners::removeSubscriber | ( | std::uint64_t | sub | ) |
Stop publishing to a subscriber.
Definition at line 13 of file BookListeners.cpp.
| void ripple::BookListeners::publish | ( | MultiApiJson const & | jvObj, |
| hash_set< std::uint64_t > & | havePublished | ||
| ) |
Publish a transaction to subscribers.
Publish a transaction to clients subscribed to changes on this book. Uses havePublished to prevent sending duplicate transactions to clients that have subscribed to multiple books.
| jvObj | JSON transaction data to publish |
| havePublished | InfoSub sequence numbers that have already published this transaction. |
Definition at line 20 of file BookListeners.cpp.
|
private |
Definition at line 48 of file BookListeners.h.
|
private |
Definition at line 50 of file BookListeners.h.