#ifndef __ASYNC_WATCHACTION_HPP__ #define __ASYNC_WATCHACTION_HPP__ #include #include "proto/rpc.grpc.pb.h" #include "v3/include/Action.hpp" #include "v3/include/AsyncWatchResponse.hpp" #include "etcd/Response.hpp" using grpc::ClientAsyncReaderWriter; using etcdserverpb::WatchRequest; using etcdserverpb::WatchResponse; namespace etcdv3 { class AsyncWatchAction : public etcdv3::Action { public: AsyncWatchAction(etcdv3::ActionParameters param); AsyncWatchResponse ParseResponse(); void waitForResponse(); void waitForResponse(std::function callback); void CancelWatch(); void WatchReq(std::string const & key); WatchResponse reply; KV::Stub* kv_stub; std::unique_ptr> stream; bool isCancelled; }; } #endif