Пример #1
0
 public void Send(ZKEvent @event)
 {
     if (_zkTask != null && _zkTask.Status != TaskStatus.Canceled)
     {
         _events.Add(@event);
     }
 }
Пример #2
0
 public void Send(ZKEvent @event)
 {
     if (_zkTask != null && _zkTask.Status != TaskStatus.Canceled)
     {
         LOG.Debug($"New event: {@event.ToString()}");
         _events.Add(@event);
     }
 }
Пример #3
0
 public void Send(ZKEvent @event)
 {
     if (_zkTask != null && _zkTask.Status != TaskStatus.Canceled)
     {
         LOG.Debug("New event: " + @event);
         _events.Add(@event);
     }
 }
Пример #4
0
        public bool DequeueEvent(out ZKEvent zkEvent)
        {
            zkEvent = new ZKEvent();

            IntPtr nodePath;

            var result = NativeDequeueEvent(NativeHandle, out nodePath, out zkEvent.State, out zkEvent.EventType);

            if (result == 0)
            {
                zkEvent.NodePath = Marshal.PtrToStringAnsi(nodePath);
            }

            return(result == 0);
        }
Пример #5
0
 public void Run()
 {
     while (!tokenSource.IsCancellationRequested)
     {
         ZKEvent zkEvent = _events.Take();
         try
         {
             zkEvent.Run();
         }
         catch (Exception e)
         {
             LOG.Error($"Error handling event {zkEvent.ToString()}", e);
         }
     }
 }
Пример #6
0
 public void Run()
 {
     while (!tokenSource.IsCancellationRequested)
     {
         LOG.Info("Starting ZookeeperClient event thread.");
         ZKEvent zkEvent = _events.Take();
         Interlocked.Increment(ref _eventId);
         int eventId = _eventId;
         LOG.Debug($"Delivering event #{eventId}{zkEvent.ToString()}");
         try
         {
             zkEvent.Run();
         }
         catch (Exception e)
         {
             LOG.Error($"Error handling event {zkEvent.ToString()}", e);
         }
         LOG.Debug($"Delivering event #{eventId} done");
     }
 }
Пример #7
0
 public void Run()
 {
     while (!tokenSource.IsCancellationRequested)
     {
         LOG.Info("Starting ZKClient event thread.");
         ZKEvent zkEvent = _events.Take();
         Interlocked.Increment(ref _eventId);
         int eventId = _eventId;
         LOG.Debug("Delivering event #" + eventId + " " + zkEvent);
         try
         {
             zkEvent.Run();
         }
         catch (ZKInterruptedException e)
         {
             tokenSource.Cancel();
         }
         catch (Exception e)
         {
             LOG.Error("Error handling event " + zkEvent, e);
         }
         LOG.Debug("Delivering event #" + eventId + " done");
     }
 }