Beispiel #1
0
        protected void Run()
        {
            if (mTokenSource.IsCancellationRequested && CurrentState.State == EventSourceState.CLOSED)
            {
                return;
            }

            mCurrentState.Run(this.OnEventReceived, mTokenSource.Token).ContinueWith(cs =>
            {
                CurrentState = cs.Result;
                Run();
            });
        }
Beispiel #2
0
        protected void Run()
        {
            if (mTokenSource.IsCancellationRequested && CurrentState.State == EventSourceState.CLOSED)
            {
                return;
            }

            _currentState.Run(this.OnEventReceived, mTokenSource.Token).ContinueWith(cs =>
            {
                try
                {
                    CurrentState = cs.Result;
                }
                catch (Exception e)
                {
                    _logger.LogWarning(e, "Exception in EventSource loop {@CurrentState}", CurrentState);
                }
                finally
                {
                    Run();
                }
            });
        }