private IObservable <EventStreamTrackingPipelineState> ContinuousAllEventStreamsFromWithTracker(string trackerId)
        {
            if (trackerRepository == null)
            {
                throw new ArgumentNullException("trackerRepository");
            }

            return(Observable.Create <EventStreamTrackingPipelineState>(async observer =>
            {
                var tracker = await this.GetTrackerOrCreate(trackerId);

                if (tracker.Type != CheckpointType.GlobalCheckpoint)
                {
                    throw new EventStoreClientInvalidTrackerCheckpointException();
                }

                return EventStoreObservables.ContinuousAllEventStreamsFrom(this.Client, tracker.GlobalCheckpoint)
                .Subscribe(revision =>
                {
                    observer.OnNext(new EventStreamTrackingPipelineState
                    {
                        Tracker = tracker,
                        Revision = revision
                    });
                },
                           observer.OnError,
                           observer.OnCompleted);
            }));
        }
 private async Task ContinuouslyCatchUpAllEventStreams(GlobalCheckpoint initialCommit, Func <Revision, Task> handleRevision,
                                                       CancellationToken cancellationToken)
 {
     try
     {
         // Subscribe to all event streams and execute onNext action and save changes for each revision received
         await(EventStoreObservables.ContinuousAllEventStreamsFrom(this.EventStreamReader, initialCommit)
               .SelectFromAsync(handleRevision)
               .RetryWithBackoffStrategy(retryCount: int.MaxValue, retryOnError: e => e is EventStreamTrackedReaderDbConcurrencyException)
               .ToTask(cancellationToken));
     }
     catch (InvalidOperationException ex)
     {
         if (ex.HResult == -2146233079)
         {
             // TODO: Write to log instead of the console
             Console.WriteLine(string.Format("An invalid operation exception has been thrown with code {0} when processing results from the server. Perhaps you are already up to date. Detailed error: {1}", ex.HResult, ex.Message));
         }
         else
         {
             throw ex;
         }
     }
 }