Commit bbb15c70 authored by Ramon Nou's avatar Ramon Nou
Browse files

WIP BW Shaping messages

parent b8003af7
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -250,6 +250,17 @@ struct fmt::formatter<cargo::shaper_message> : formatter<std::string_view> {
    }
};

template <>
struct fmt::formatter<cargo::shaper_message> : formatter<std::string_view> {
    // parse is inherited from formatter<string_view>.
    template <typename FormatContext>
    auto
    format(const cargo::shaper_message& s, FormatContext& ctx) const {
    const auto str = fmt::format("{{tid: {}, shaping: {}}}", s.tid(), s.shaping());
        return formatter<std::string_view>::format(str, ctx);
    }
};

template <>
struct fmt::formatter<cargo::shutdown_message> : formatter<std::string_view> {
    // parse is inherited from formatter<string_view>.
+10 −0
Original line number Diff line number Diff line
@@ -196,6 +196,16 @@ worker::run() {
                break;
            }

            case tag::bw_shaping: {
                shaper_message m;
                world.recv(msg->source(), msg->tag(), m);
                LOGGER_INFO("msg => from: {} body: {}", msg->source(), m);

                // TODO: Do something with m.shaping;

                break;
            }

            case tag::shutdown:
                LOGGER_INFO("msg => from: {} body: {{shutdown}}",
                            msg->source());