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); }
/// <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(); }