mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-29 19:23:16 +00:00
update(userspace/falco): use concurrent output queue in grpc server impl
Co-authored-by: Lorenzo Fontana <lo@linux.com> Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
parent
5f29d46cb3
commit
4f23b0bdfb
@ -37,6 +37,7 @@ void falco_grpc_server_impl::subscribe(const stream_context& ctx, const falco_ou
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
auto m_event_queue = falco_output_queue::get().queue();
|
||||||
// Start (or continue) streaming
|
// Start (or continue) streaming
|
||||||
// ctx.m_status == stream_context::STREAMING
|
// ctx.m_status == stream_context::STREAMING
|
||||||
if(m_event_queue.try_pop(res) && !req.keepalive())
|
if(m_event_queue.try_pop(res) && !req.keepalive())
|
||||||
|
@ -20,26 +20,16 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#include "tbb/concurrent_queue.h"
|
#include "falco_output_queue.h"
|
||||||
#include "falco_output.grpc.pb.h"
|
#include "falco_output.grpc.pb.h"
|
||||||
#include "falco_output.pb.h"
|
|
||||||
#include "grpc_context.h"
|
#include "grpc_context.h"
|
||||||
|
|
||||||
typedef tbb::concurrent_queue<falco_output_response> falco_output_response_cq;
|
|
||||||
|
|
||||||
class falco_grpc_server_impl
|
class falco_grpc_server_impl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
falco_grpc_server_impl() = default;
|
falco_grpc_server_impl() = default;
|
||||||
~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:
|
protected:
|
||||||
bool is_running();
|
bool is_running();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user