From 4f23b0bdfba990ce194f77654ae3190c10009787 Mon Sep 17 00:00:00 2001 From: Leonardo Di Donato Date: Fri, 6 Sep 2019 14:05:57 +0000 Subject: [PATCH] update(userspace/falco): use concurrent output queue in grpc server impl Co-authored-by: Lorenzo Fontana Signed-off-by: Leonardo Di Donato --- userspace/falco/grpc_server_impl.cpp | 1 + userspace/falco/grpc_server_impl.h | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/userspace/falco/grpc_server_impl.cpp b/userspace/falco/grpc_server_impl.cpp index f89082a6..c8138683 100644 --- a/userspace/falco/grpc_server_impl.cpp +++ b/userspace/falco/grpc_server_impl.cpp @@ -37,6 +37,7 @@ void falco_grpc_server_impl::subscribe(const stream_context& ctx, const falco_ou } else { + auto m_event_queue = falco_output_queue::get().queue(); // Start (or continue) streaming // ctx.m_status == stream_context::STREAMING if(m_event_queue.try_pop(res) && !req.keepalive()) diff --git a/userspace/falco/grpc_server_impl.h b/userspace/falco/grpc_server_impl.h index 7b169b53..c64fbb23 100644 --- a/userspace/falco/grpc_server_impl.h +++ b/userspace/falco/grpc_server_impl.h @@ -20,26 +20,16 @@ limitations under the License. #include -#include "tbb/concurrent_queue.h" +#include "falco_output_queue.h" #include "falco_output.grpc.pb.h" -#include "falco_output.pb.h" #include "grpc_context.h" -typedef tbb::concurrent_queue falco_output_response_cq; - class falco_grpc_server_impl { public: falco_grpc_server_impl() = default; ~falco_grpc_server_impl() = default; - falco_output_response_cq& m_event_queue; - - falco_grpc_server_impl(falco_output_response_cq& event_queue): - m_event_queue(event_queue) - { - } - protected: bool is_running();