CatapultServer  v0.5.0.1 (Elephant)
DispatcherUtils.h
Go to the documentation of this file.
1 
21 #pragma once
25 #include "catapult/thread/Task.h"
26 
27 namespace catapult {
28  namespace config { struct NodeConfiguration; }
29  namespace extensions { class ServiceLocator; }
30  namespace subscribers { class TransactionStatusSubscriber; }
31 }
32 
33 namespace catapult { namespace extensions {
34 
36  consumers::HashCheckOptions CreateHashCheckOptions(const utils::TimeSpan& cacheDuration, const config::NodeConfiguration& nodeConfig);
37 
39  chain::FailedTransactionSink SubscriberToSink(subscribers::TransactionStatusSubscriber& subscriber);
40 
42  void AddDispatcherCounters(ServiceLocator& locator, const std::string& dispatcherName, const std::string& counterPrefix);
43 
46 
48  thread::Task CreateBatchTransactionTask(TransactionBatchRangeDispatcher& dispatcher, const std::string& name);
49 }}
catapult::config::NodeConfiguration::ShortLivedCacheMaxSize
uint32_t ShortLivedCacheMaxSize
Maximum size of a short lived cache.
Definition: NodeConfiguration.h:76
catapult::extensions::AddDispatcherCounters
void AddDispatcherCounters(ServiceLocator &locator, const std::string &dispatcherName, const std::string &counterPrefix)
Adds dispatcher counters with prefix counterPrefix to locator for a dispatcher named dispatcherName.
Definition: DispatcherUtils.cpp:43
catapult::extensions::CreateBatchTransactionTask
thread::Task CreateBatchTransactionTask(TransactionBatchRangeDispatcher &dispatcher, const std::string &name)
Creates a task with name that dispatches all transactions batched in dispatcher.
Definition: DispatcherUtils.cpp:54
Task.h
ConsumerDispatcher.h
catapult::chain::FailedTransactionSink
consumer< const model::Transaction &, const Hash256 &, validators::ValidationResult > FailedTransactionSink
Indicates a transaction with the specified hash failed validation.
Definition: ChainFunctions.h:33
catapult::disruptor::ConsumerDispatcher
Dispatcher for disruptor consumers.
Definition: ConsumerDispatcher.h:35
catapult::config::NodeConfiguration
Node configuration settings.
Definition: NodeConfiguration.h:33
BatchRangeDispatcher.h
ServiceLocator.h
catapult::utils::TimeSpan
Represents a time duration.
Definition: TimeSpan.h:30
catapult::utils::to_underlying_type
constexpr std::underlying_type_t< TEnum > to_underlying_type(TEnum value)
Converts a strongly typed enumeration value to its underlying integral value.
Definition: Casting.h:37
HashCheckOptions.h
catapult::extensions::CreateHashCheckOptions
consumers::HashCheckOptions CreateHashCheckOptions(const utils::TimeSpan &cacheDuration, const config::NodeConfiguration &nodeConfig)
Creates hash check options based on cacheDuration and nodeConfig.
Definition: DispatcherUtils.cpp:30
catapult::disruptor::BatchRangeDispatcher
Batches entity ranges for processing by a ConsumerDispatcher.
Definition: BatchRangeDispatcher.h:33
catapult::thread::CreateNamedTask
Task CreateNamedTask(const std::string &name, const TaskCallback &callback)
Creates an unscheduled task with name and callback.
Definition: Task.cpp:52
catapult::extensions::SubscriberToSink
chain::FailedTransactionSink SubscriberToSink(subscribers::TransactionStatusSubscriber &subscriber)
Converts subscriber to a sink.
Definition: DispatcherUtils.cpp:37
NodeConfiguration.h
TransactionStatusSubscriber.h
catapult::thread::TaskResult::Continue
Task should repeat.
DispatcherUtils.h
catapult::thread::make_ready_future
future< T > make_ready_future(T &&value)
Produces a future that is ready immediately and holds the given value.
Definition: Future.h:126
catapult::utils::TimeSpan::millis
constexpr uint64_t millis() const
Returns the number of milliseconds.
Definition: TimeSpan.h:91
TimeSpan.h
ChainFunctions.h
catapult::disruptor::BatchRangeDispatcher::dispatch
void dispatch()
Dispatches all queued elements to the underlying dispatcher.
Definition: BatchRangeDispatcher.h:69
catapult::subscribers::TransactionStatusSubscriber::notifyStatus
virtual void notifyStatus(const model::Transaction &transaction, const Hash256 &hash, uint32_t status)=0
Indicates transaction with hash completed with status.
catapult::config::NodeConfiguration::ShortLivedCachePruneInterval
utils::TimeSpan ShortLivedCachePruneInterval
Time between short lived cache pruning.
Definition: NodeConfiguration.h:73
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::consumers::HashCheckOptions
Options for configuring the hash check consumer.
Definition: HashCheckOptions.h:27
catapult::extensions::ServiceLocator::registerServiceCounter
void registerServiceCounter(const std::string &serviceName, const std::string &counterName, TSupplier supplier)
Adds a service-dependent counter with counterName for service serviceName given supplier.
Definition: ServiceLocator.h:97
catapult::thread::Task
A task that can be dispatched to the scheduler.
Definition: Task.h:45
catapult::subscribers::TransactionStatusSubscriber
Transaction status subscriber.
Definition: TransactionStatusSubscriber.h:30
catapult::extensions::ServiceLocator
A service locator for local node services.
Definition: ServiceLocator.h:33