Beispiel #1
0
 private static async Task processEvent(WatcherSetEventPair @event)
 {
     foreach (Watcher watcher in @event.watchers)
     {
         try {
             await watcher.process(@event.@event).ConfigureAwait(false);
         } catch (Exception t) {
             LOG.error("Error while calling watcher ", t);
         }
     }
 }
Beispiel #2
0
        private void queueEvent(WatchedEvent @event)
        {
            if (@event.get_Type() == Watcher.Event.EventType.None &&
                sessionState.Value == @event.getState())
            {
                return;
            }
            sessionState.Value = @event.getState();
            // materialize the watchers based on the event
            WatcherSetEventPair pair = new WatcherSetEventPair(
                watcher.materialize(@event.getState(), @event.get_Type(),
                                    @event.getPath()), @event);

            // queue the pair (watch set & event) for later processing
            waitingEvents.Enqueue(pair);
            waitingEventsSignal.Set();
        }