public void Send(ZKEvent @event) { if (_zkTask != null && _zkTask.Status != TaskStatus.Canceled) { _events.Add(@event); } }
public void Send(ZKEvent @event) { if (_zkTask != null && _zkTask.Status != TaskStatus.Canceled) { LOG.Debug($"New event: {@event.ToString()}"); _events.Add(@event); } }
public void Send(ZKEvent @event) { if (_zkTask != null && _zkTask.Status != TaskStatus.Canceled) { LOG.Debug("New event: " + @event); _events.Add(@event); } }
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); }
public void Run() { while (!tokenSource.IsCancellationRequested) { ZKEvent zkEvent = _events.Take(); try { zkEvent.Run(); } catch (Exception e) { LOG.Error($"Error handling event {zkEvent.ToString()}", e); } } }
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"); } }
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"); } }