handle messages concurrently

This commit is contained in:
2022-04-26 20:30:23 +02:00
parent 06b00843d2
commit 14d0716607
3 changed files with 48 additions and 20 deletions

View File

@@ -96,6 +96,7 @@ class draw_rectangle : public generic_message<Type::DRAW_RECTANGLE> {
virtual void handle_message() override {
spdlog::debug("draw_rectangle::handle_message()");
spdlog::debug("Position: X = {}, Y = {}", position.x, position.y);
spdlog::debug("handle_message sleeps for 1 sec to test concurrency");
std::this_thread::sleep_for(std::chrono::seconds(1));
}
@@ -113,6 +114,7 @@ class draw_pixel : public generic_message<Type::DRAW_PIXEL> {
virtual void handle_message() override {
spdlog::debug("draw_pixel::handle_message()");
spdlog::debug("Color: ({}, {}, {})", color.x, color.y, color.z);
spdlog::debug("handle_message sleeps for 1 sec to test concurrency");
std::this_thread::sleep_for(std::chrono::seconds(1));
}