#include "subscription_engine.hpp"
template<typename EventKey, typename Dispatcher, typename Receiver>
class iroha::subscription::SubscriptionEngine< EventKey, Dispatcher, Receiver >
- Template Parameters
-
| EventKey | - the type of a specific event from event set (e. g. a key from a storage or a particular kind of event from an enumeration) |
| Dispatcher | - thread handler |
| Receiver | - the type of an object that is a part of a Subscriber internal state and can be accessed on every event |
◆ DispatcherPtr
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ DispatcherType
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ EventKeyType
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ IteratorType
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ ReceiverType
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ SubscribersContainer
template<typename EventKey , typename Dispatcher , typename Receiver >
List is preferable here because this container iterators remain alive after removal from the middle of the container using custom allocator
◆ SubscriberType
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ SubscriberWeakPtr
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ SubscriptionEngine()
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ ~SubscriptionEngine()
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ dispose()
template<typename EventKey , typename Dispatcher , typename Receiver >
◆ notify()
template<typename EventKey , typename Dispatcher , typename Receiver >
template<typename... EventParams>
Notify the event subscribers without delay
- Template Parameters
-
| EventParams | notification event type |
- Parameters
-
| key | notification event to be executed |
| args | event data to transmit |
◆ notifyDelayed()
template<typename EventKey , typename Dispatcher , typename Receiver >
template<typename... EventParams>
Notify the event subscribers after a specified delay
- Template Parameters
-
| EventParams | notification event type |
- Parameters
-
| timeout | delay before subscribers will be notified |
| key | notification event to be executed |
| args | event data to transmit |
◆ size() [1/2]
template<typename EventKey , typename Dispatcher , typename Receiver >
Number of subscribers which listen to the current notification event
- Parameters
-
- Returns
- number of subscribers
◆ size() [2/2]
template<typename EventKey , typename Dispatcher , typename Receiver >
Number of subscribers which listen to all notification events
- Returns
- number of subscribers
◆ subscribe()
template<typename EventKey , typename Dispatcher , typename Receiver >
Stores Subscriber object to retrieve later notifications
- Parameters
-
| tid | Thread ID in which subscribers callback will be executed |
| set_id | subscription set id is a group identifier in multiple subscriptions |
| key | notification event key that this subscriber will listen to |
| ptr | subscriber weak pointer |
- Returns
- a position in an internal container with subscribers(!!! it must be kept valid in case the other subscriber will be deleted from this container)
◆ unsubscribe()
template<typename EventKey , typename Dispatcher , typename Receiver >
Stops the subscriber from listening to events
- Parameters
-
| key | notification event that must be unsubscribed |
| it_remove | iterator to the subscribers position |
The documentation for this class was generated from the following file: