Beispiel #1
0
        // notifies all watchers about a exception. it doesn't close watchers.
        // it is the responsibility of user to close watchers.
        private void notifyWatchers(EtcdException e)
        {
            WatchResponseWithError wre = new WatchResponseWithError(e);

            if (!this.pendingWatchers.IsEmpty)
            {
                while (!this.pendingWatchers.IsEmpty)
                {
                    // this.pendingWatchers.try
                }
            }
            //this.pendingWatchers.forEach(watcher -> {
            //  try {
            //    watcher.enqueue(wre);
            //  } catch (Exception we) {
            //    LOG.warn("failed to notify watcher", we);
            //  }
            //});
            //this.pendingWatchers.clear();
            //this.watchers.values().forEach(watcher -> {
            //  try {
            //    watcher.enqueue(wre);
            //  } catch (Exception we) {
            //    LOG.warn("failed to notify watcher", we);
            //  }
            //});
            this.watchers.Clear();
        }
Beispiel #2
0
 private void enqueue(WatchResponseWithError watchResponse)
 {
     try {
         this.eventsQueue.Enqueue(watchResponse);
     } catch (Exception e) {
         Thread.CurrentThread.Interrupt();
         //LOG.warn("Interrupted", e);
     }
 }
Beispiel #3
0
            private WatchResponse CreateWatchResponseFuture()
            {
                WatchResponseWithError watchResponse = null;

                this.eventsQueue.TryDequeue(out watchResponse);
                if (watchResponse != null)
                {
                    return(new WatchResponse(watchResponse.GetWatchResponse()));
                }
                else
                {
                    return(null);
                }
            }
Beispiel #4
0
 internal void Enqueue(WatchResponseWithError watchResponseWithError)
 {
     throw new NotImplementedException();
 }