diff options
author | Tim Cooper <tim.cooper@layeh.com> | 2015-06-17 22:08:36 +0300 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2016-05-08 17:45:52 +0300 |
commit | 3a1da385b9e4aa72314574cdaea7a3de163420c5 (patch) | |
tree | fcb35f620e4ad8000d7a3fefab7df6711200efe4 /src/murmur/MurmurGRPCImpl.h | |
parent | 0fdb1dfb06ac1baaf555bc9825ea77185232badd (diff) |
grpc: add callback() method to single-streaming calls, reenable ContextActionService.Events
Diffstat (limited to 'src/murmur/MurmurGRPCImpl.h')
-rw-r--r-- | src/murmur/MurmurGRPCImpl.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/murmur/MurmurGRPCImpl.h b/src/murmur/MurmurGRPCImpl.h index 49b15e4dc..e18b0f2ae 100644 --- a/src/murmur/MurmurGRPCImpl.h +++ b/src/murmur/MurmurGRPCImpl.h @@ -35,6 +35,7 @@ #include "MurmurRPC.grpc.pb.h" #include "Server.h" +#include "Meta.h" #include <QMultiHash> @@ -54,10 +55,16 @@ class RPCExecEvent : public ExecEvent { Q_DISABLE_COPY(RPCExecEvent); public: RPCCall *call; - RPCExecEvent(boost::function<void()> fn, RPCCall *call) : ExecEvent(fn), call(call) { + RPCExecEvent(::boost::function<void()> fn, RPCCall *call) : ExecEvent(fn), call(call) { } }; +namespace MurmurRPC { +namespace Wrapper { +struct ContextActionService_Events; +} +} + class MurmurRPCImpl : public QThread { Q_OBJECT; std::unique_ptr<grpc::Server> mServer; @@ -86,13 +93,8 @@ class MurmurRPCImpl : public QThread { MurmurRPC::UserService::AsyncService aUserService; // ContextActionService - struct ContextActionListener { - ::grpc::ServerAsyncWriter<::MurmurRPC::ContextAction> *w; - ::boost::function<void()> *next; - ContextActionListener(::grpc::ServerAsyncWriter<::MurmurRPC::ContextAction> *w, ::boost::function<void()> *next) : w(w), next(next) { - } - }; - QHash<int, QMultiHash<QString, ContextActionListener *> > qhContextActionListeners; + QHash<int, QMultiHash<QString, ::MurmurRPC::Wrapper::ContextActionService_Events *> > qhContextActionListeners; + void contextActionCb(::MurmurRPC::Wrapper::ContextActionService_Events *stream, bool ok); public slots: void started(Server *server); |