Exemplo n.º 1
0
        public ICloseableClient KeepAlive(long leaseId)
        {
            Grpc.Core.CallOptions callOptions = new Grpc.Core.CallOptions();
            //callOptions.
            var rsp = leaseClient.LeaseKeepAlive(callOptions);

            return(null);
        }
Exemplo n.º 2
0
        public ICloseableClient KeepAlive(long leaseId)
        {
            KeepAlive <Etcdserverpb.LeaseKeepAliveRequest, Etcdserverpb.LeaseKeepAliveResponse> item = null;

            if (!keepAlives.TryGetValue(leaseId, out item))
            {
                item = new KeepAlive <Etcdserverpb.LeaseKeepAliveRequest, Etcdserverpb.LeaseKeepAliveResponse>(leaseId);
            }

            Grpc.Core.CallOptions callOptions = new Grpc.Core.CallOptions();
            //callOptions.

            var rsp = leaseClient.LeaseKeepAlive(callOptions);

            item.AddObserver(rsp);

            return(item);
        }
Exemplo n.º 3
0
        public EtcdClient(params Uri[] etcdUrls)
        {
            this.channel     = new Channel(etcdUrls[0].Host, etcdUrls[0].Port, ChannelCredentials.Insecure);
            this.kvClient    = new KV.KVClient(channel);
            this.watchClient = new WatchClient(this.channel);
            this.leaseClient = new LeaseClient(this.channel);
            var asyncDuplexStreamingCall = leaseClient.LeaseKeepAlive();

            this.leaseTTLRefresher = new EtcdLeaseTTLRefresher(asyncDuplexStreamingCall);
        }