private bool Reading(object message)
        {
            switch (message)
            {
            case ReplicationReadSuccess s:
                this.detector.Tell(FailureDetectorChange.AvailabilityDetected);
                Context.Become(Writing);
                Write(s.Events, s.ReplicationProgress, s.CurrentSourceVersionVector, s.ReplicationProgress >= s.FromSequenceNr);
                return(true);

            case ReplicationReadFailure f:
                this.detector.Tell(FailureDetectorChange.FailureDetected(f.Cause));
                log.Warning("Replication read failed: {0}", f.Cause);
                Context.Become(Idle);
                ScheduleRead();
                return(true);

            default: return(false);
            }
        }
 private ICancelable ScheduleFailureDetectionLimitReached()
 {
     this.counter++;
     return(Context.System.Scheduler.ScheduleTellOnceCancelable(this.failureDetectionLimit, Self, FailureDetectorChange.FailureDetectionLimitReached(counter), Self));
 }