Esempio n. 1
0
        private void Poll()
        {
            _cancellationToken = new CancellationTokenSource();
            var self = Self;

            _longRunningTask = _projectionEngine.Poll(_cancellationToken.Token)
                               .ContinueWith(x =>
            {
                if (x.IsCanceled || x.IsFaulted)
                {
                    return(new PollingCompleted(false));
                }
                return(new PollingCompleted(true));
            }, TaskContinuationOptions.ExecuteSynchronously)
                               .PipeTo(self);
            Become(Working);
        }
Esempio n. 2
0
 /// <summary>
 /// blocking an actor wi a very long time might not be a good idea
 /// It's non responsing to other messages (even system messages)
 /// </summary>
 private void Poll()
 {
     _projectionEngine.Poll();
 }