broker and cluster: Switch to new Enqueue() API

This is a bit intermediary. In part 2 this will deal with any metadata,
not just timestamps.
This commit is contained in:
Arne Welzel 2025-05-21 17:47:55 +02:00
parent 75aa6588fe
commit 506fea3335
2 changed files with 12 additions and 3 deletions

View file

@ -1655,8 +1655,13 @@ void Manager::ProcessMessage(std::string_view topic, broker::zeek::Event& ev) {
} }
} }
if ( vl.size() == args.size() ) if ( vl.size() == args.size() ) {
event_mgr.Enqueue(handler, std::move(vl), util::detail::SOURCE_BROKER, 0, nullptr, ts); zeek::detail::EventMetadataVectorPtr meta;
if ( ts > 0.0 )
meta = zeek::detail::MakeEventMetadataVector(ts);
event_mgr.Enqueue(std::move(meta), handler, std::move(vl), util::detail::SOURCE_BROKER);
}
} }
bool Manager::ProcessMessage(std::string_view, broker::zeek::LogCreate& lc) { bool Manager::ProcessMessage(std::string_view, broker::zeek::LogCreate& lc) {

View file

@ -23,7 +23,11 @@ using namespace zeek::cluster;
bool detail::LocalEventHandlingStrategy::DoProcessEvent(std::string_view topic, detail::Event e) { bool detail::LocalEventHandlingStrategy::DoProcessEvent(std::string_view topic, detail::Event e) {
zeek::event_mgr.Enqueue(e.Handler(), std::move(e.Args()), util::detail::SOURCE_BROKER, 0, nullptr, e.Timestamp()); zeek::detail::EventMetadataVectorPtr meta;
if ( auto ts = e.Timestamp(); ts > 0.0 )
meta = zeek::detail::MakeEventMetadataVector(e.Timestamp());
zeek::event_mgr.Enqueue(std::move(meta), e.Handler(), std::move(e.Args()), util::detail::SOURCE_BROKER);
return true; return true;
} }