new(userspace/falco): gRPC context for bidirectional services

Co-authored-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
This commit is contained in:
Leonardo Di Donato 2020-05-27 20:03:09 +00:00 committed by poiana
parent a72f27c028
commit be6c4b273d

View File

@ -63,5 +63,24 @@ public:
mutable bool m_has_more = false;
};
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?
};
} // namespace grpc
} // namespace falco