update(userspace/falco/grpc): for stream contexts use a flag to detect

if it is still running or not

Co-Authored-By: Leonardo Di Donato <leodidonato@gmail.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
This commit is contained in:
Lorenzo Fontana 2020-05-29 14:12:39 +02:00 committed by poiana
parent d9f2cda8cf
commit 0d194f2b40

View File

@ -50,7 +50,7 @@ class stream_context : public context
public:
stream_context(::grpc::ServerContext* ctx):
context(ctx){};
~stream_context() = default;
virtual ~stream_context() = default;
enum : char
{
@ -61,35 +61,15 @@ public:
mutable void* m_stream = nullptr; // todo(fntlnz, leodido) > useful in the future
mutable bool m_has_more = false;
mutable bool m_is_running = true;
};
// class bidi_context : public context
// {
// public:
// bidi_context(::grpc::ServerContext* ctx):
// context(ctx){};
// ~bidi_context() = default;
// enum : char
// {
// WAIT_CONNECT = 1,
// READY_TO_WRITE,
// WAIT_WRITE_DONE,
// FINISHED,
// } m_status = WAIT_CONNECT;
// mutable void* m_stream = nullptr; // todo(fntlnz, leodido) > useful in the future
// mutable bool m_has_more = false; // fixme > needed?
// };
class bidi_context : public stream_context
{
public:
bidi_context(::grpc::ServerContext* ctx):
stream_context(ctx){};
~bidi_context() = default;
mutable bool m_wait_write_done = false;
virtual ~bidi_context() = default;
};
} // namespace grpc