CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
26 namespace catapult {
namespace subscribers {
31 template<
typename TSubscriber,
typename =
void>
33 static void Flush(
const TSubscriber&)
37 template<
typename TSubscriber>
39 static void Flush(TSubscriber& subscriber) {
48 template<
typename TSubscriber,
typename TMessageReader>
50 while (!inputStream.
eof())
51 readNextMessage(inputStream, subscriber);
57 template<
typename TSubscriber,
typename TMessageReader>
59 bool shouldContinue =
true;
60 while (shouldContinue) {
61 shouldContinue = reader.
tryReadNextMessage([&subscriber, readNextMessage](
const auto& buffer) {
63 ReadAll(inputStream, subscriber, readNextMessage);
81 template<
typename TSubscriber,
typename TMessageReader>
85 auto numPendingMessages = reader.
pending();
86 if (0 == numPendingMessages)
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
def debug(*args)
Definition: Parser.py:46
void ReadAll(io::InputStream &inputStream, TSubscriber &subscriber, TMessageReader readNextMessage)
Reads all messages from inputStream into subscriber using readNextMessage.
Definition: BrokerMessageReaders.h:49
std::string IndexWriterFilename
Name of index writer file.
Definition: BrokerMessageReaders.h:77
std::string IndexReaderFilename
Name of index reader file.
Definition: BrokerMessageReaders.h:74
File based queue reader where each message is represented by a file (with incrementing names) in a di...
Definition: FileQueue.h:51
typename is_type_expression< T, Enable >::type is_type_expression_t
true if the expression is valid and evaluates to a type, false otherwise.
Definition: Traits.h:98
bool tryReadNextMessage(const consumer< std::vector< uint8_t >> &consumer)
Tries to read the next message and forwards it to consumer if successful.
Definition: FileQueue.cpp:114
Definition: AddressExtractionExtension.cpp:28
std::string QueuePath
Path of the message queue.
Definition: BrokerMessageReaders.h:71
size_t pending() const
Gets the number of pending messages.
Definition: FileQueue.cpp:108
Definition: BrokerMessageReaders.h:32
Describes a message queue.
Definition: BrokerMessageReaders.h:69
static void Flush(const TSubscriber &)
Definition: BrokerMessageReaders.h:33