|
Clio
develop
The XRP Ledger API server.
|
Implementation of SubscriptionContextInterface. More...
#include <SubscriptionContext.hpp>


Public Types | |
| using | ErrorHandler = std::function<bool(Error const&, Connection const&)> |
| Error handler definition. Error handler returns true if connection should be closed false otherwise. | |
| Public Types inherited from web::SubscriptionContextInterface | |
| using | OnDisconnectSlot = std::function<void(SubscriptionContextInterface*)> |
| Alias for on disconnect slot. | |
Public Member Functions | |
| SubscriptionContext (util::TagDecoratorFactory const &factory, impl::WsConnectionBase &connection, boost::asio::yield_context yield, ErrorHandler errorHandler) | |
| Construct a new Subscription Context object. | |
| ~SubscriptionContext () override | |
| Destroy the Subscription Context object. | |
| void | send (std::shared_ptr< std::string > message) override |
| Send message to the client. | |
| void | onDisconnect (OnDisconnectSlot const &slot) override |
| Connect a slot to onDisconnect connection signal. | |
| void | setApiSubversion (uint32_t value) override |
| Set the API subversion. | |
| uint32_t | apiSubversion () const override |
| Get the API subversion. | |
| void | disconnect (boost::asio::yield_context yield) |
| Notify the context that related connection is disconnected and wait for all the task to complete. | |
| Public Member Functions inherited from web::SubscriptionContextInterface | |
| Taggable (util::TagDecoratorFactory const &tagFactory) | |
| New Taggable from a specified factory. | |
| Taggable (Taggable &&)=default | |
| Public Member Functions inherited from util::Taggable | |
| Taggable (Taggable &&)=default | |
| Taggable & | operator= (Taggable &&)=default |
| BaseTagDecorator const & | tag () const |
| Getter for tag decorator. | |
Additional Inherited Members | |
| Protected Member Functions inherited from util::Taggable | |
| Taggable (util::TagDecoratorFactory const &tagFactory) | |
| New Taggable from a specified factory. | |
Implementation of SubscriptionContextInterface.
| web::ng::SubscriptionContext::SubscriptionContext | ( | util::TagDecoratorFactory const & | factory, |
| impl::WsConnectionBase & | connection, | ||
| boost::asio::yield_context | yield, | ||
| ErrorHandler | errorHandler ) |
Construct a new Subscription Context object.
| factory | The tag decorator factory to use to init taggable. |
| connection | The connection for which the context is created. |
| yield | The yield context to spawn sending coroutines. |
| errorHandler | The error handler. |
|
override |
Destroy the Subscription Context object.
|
nodiscardoverridevirtual |
| void web::ng::SubscriptionContext::disconnect | ( | boost::asio::yield_context | yield | ) |
Notify the context that related connection is disconnected and wait for all the task to complete.
| yield | The yield context to wait for all the tasks to complete. |
|
overridevirtual |
Connect a slot to onDisconnect connection signal.
| slot | The slot to connect. |
Implements web::SubscriptionContextInterface.
|
overridevirtual |
Send message to the client.
| message | The message to send. |
Implements web::SubscriptionContextInterface.
|
overridevirtual |
Set the API subversion.
| value | The value to set. |
Implements web::SubscriptionContextInterface.