public override Task process(WatchedEvent @event) { if (@event.get_Type() != Event.EventType.None) { return(Task.CompletedTask); } var connectionEvent = new ConnectionEvent(@event, this); action(connectionEvent); return(Task.CompletedTask); }
private void ProcessEvent(ConnectionEvent connectionEvent) { log.Debug("Processing connection state event '{ConnectionEvent}'.", connectionEvent); var currentState = state; if (currentState == null || !ReferenceEquals(connectionEvent.EventFrom, currentState.ConnectionWatcher)) { return; } var newState = currentState.WithConnectionState(connectionEvent.NewConnectionState, settings); ChangeState(currentState, newState); }