hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize > Class Template Reference

#include "subscription_fwd.hpp"

Inheritance diagram for iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >:
Inheritance graph
Collaboration diagram for iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >:
Collaboration graph

Public Types

using Dispatcher = subscription::IDispatcher
 

Public Member Functions

 SubscriptionManager (DispatcherPtr dispatcher)
 
void dispose ()
 
template<typename EventKey , typename... Args>
auto getEngine ()
 
template<typename EventKey , typename... Args>
void notify (const EventKey &key, Args const &... args)
 
template<typename EventKey , typename... Args>
void notifyDelayed (std::chrono::microseconds timeout, const EventKey &key, Args const &... args)
 
DispatcherPtr dispatcher () const
 

Detailed Description

template<uint32_t kHandlersCount, uint32_t kPoolSize>
class iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >

Class-aggregator that keeps all event engines inside. On notification it selects the appropriate engine and calls notification in it.

Template Parameters
kHandlersCountnumber of supported thread handlers
kPoolSizenumber of threads in thread pool

Member Typedef Documentation

◆ Dispatcher

template<uint32_t kHandlersCount, uint32_t kPoolSize>
using iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >::Dispatcher = subscription::IDispatcher

Constructor & Destructor Documentation

◆ SubscriptionManager()

template<uint32_t kHandlersCount, uint32_t kPoolSize>
iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >::SubscriptionManager ( DispatcherPtr  dispatcher)
inline

Member Function Documentation

◆ dispatcher()

template<uint32_t kHandlersCount, uint32_t kPoolSize>
DispatcherPtr iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >::dispatcher ( ) const
inline

Getter to retrieve a dispatcher.

Returns
dispatcher object

◆ dispose()

template<uint32_t kHandlersCount, uint32_t kPoolSize>
void iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >::dispose ( )
inline

Detaches the dispatcher from all engines and stops thread handlers execution.

Here is the call graph for this function:

◆ getEngine()

template<uint32_t kHandlersCount, uint32_t kPoolSize>
template<typename EventKey , typename... Args>
auto iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >::getEngine ( )
inline

Method returns the engine corresponding to current arguments set transmission.

Template Parameters
EventKeytypeof event enum
Argsarguments list of transmitted event data types
Returns
engine object

To be sure IDisposable is the first base class, because of later cast

Here is the call graph for this function:

◆ notify()

template<uint32_t kHandlersCount, uint32_t kPoolSize>
template<typename EventKey , typename... Args>
void iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >::notify ( const EventKey &  key,
Args const &...  args 
)
inline

Make event notification to subscribers that are listening to this event

Template Parameters
EventKeytypeof event enum
Argsarguments list of transmitted event data types
Parameters
keyevent key
argstransmitted data
Here is the call graph for this function:

◆ notifyDelayed()

template<uint32_t kHandlersCount, uint32_t kPoolSize>
template<typename EventKey , typename... Args>
void iroha::subscription::SubscriptionManager< kHandlersCount, kPoolSize >::notifyDelayed ( std::chrono::microseconds  timeout,
const EventKey &  key,
Args const &...  args 
)
inline

Make event notification to subscribers that are listening this event after a delay

Template Parameters
EventKeytypeof event enum
Argsarguments list of transmitted event data types
Parameters
timeoutdelay before subscribers will be notified
keyevent key
argstransmitted data
Here is the caller graph for this function:

The documentation for this class was generated from the following files: