/// @copyright 2020 ECCI, Universidad de Costa Rica. All rights reserved /// This code is released under the GNU Public License version 3 /// @author Jeisson Hidalgo-Céspedes #include "ConsumerTest.hpp" #include "LogTest.hpp" ConsumerTest::ConsumerTest(int consumerDelay) : consumerDelay(consumerDelay) { } int ConsumerTest::run() { // Start the forever loop to consume all the messages that arrive this->consumeForever(); // If the forever loop finished, no more messages will arrive // Print statistics LogTest::append("Consumer: " + std::to_string(this->receivedMessages) + " menssages consumed"); return EXIT_SUCCESS; } void ConsumerTest::consume(const NetworkMessage& data) { (void)data; ++this->receivedMessages; }