/// <summary>
        ///
        /// </summary>
        /// <param name="event"></param>
        public void QueueEvent(WatchedEvent @event)
        {
            if (@event.Type == EventType.None && sessionState == @event.State)
            {
                return;
            }

            if (waitingEvents.IsAddingCompleted)
            {
                throw new InvalidOperationException("consumer has been disposed");
            }

            sessionState = @event.State;

            // materialize the watchers based on the event
            var pair = new ClientConnection.WatcherSetEventPair(conn.watcher.Materialize(@event.State, @event.Type, @event.Path), @event);

            // queue the pair (watch set & event) for later processing
            waitingEvents.Add(pair);
        }
 /// <summary>
 ///
 /// </summary>
 public void PollEvents()
 {
     try
     {
         while (!waitingEvents.IsCompleted)
         {
             try
             {
                 ClientConnection.WatcherSetEventPair pair = null;
                 if (waitingEvents.TryTake(out pair, -1))
                 {
                     ProcessWatcher(pair.Watchers, pair.WatchedEvent);
                 }
             }
             catch (ObjectDisposedException)
             {
             }
             catch (InvalidOperationException)
             {
             }
             catch (OperationCanceledException)
             {
                 //ignored
             }
             catch (Exception t)
             {
                 log.Error("Caught unexpected throwable", t);
             }
         }
     }
     catch (ThreadInterruptedException e)
     {
         log.Error("Event thread exiting due to interruption", e);
     }
     log.Info("EventThread shut down");
 }