Example #1
0
 void HandleRebuildResult(ReplayResult result, RebuildProjectionVersion @event)
 {
     if (result.IsSuccess)
     {
         var finalize = new FinalizeProjectionVersionRequest(@event.ProjectionVersionRequest.Id, @event.ProjectionVersionRequest.Version);
         commandPublisher.Publish(finalize);
     }
     else if (result.ShouldRetry)
     {
         RequestTimeout(new RebuildProjectionVersion(@event.ProjectionVersionRequest, DateTime.UtcNow.AddSeconds(30)));
     }
     else
     {
         log.Error(() => result.Error);
         if (result.IsTimeout)
         {
             var timedout = new TimeoutProjectionVersionRequest(@event.ProjectionVersionRequest.Id, @event.ProjectionVersionRequest.Version, @event.ProjectionVersionRequest.Timebox);
             commandPublisher.Publish(timedout);
         }
         else
         {
             var cancel = new CancelProjectionVersionRequest(@event.ProjectionVersionRequest.Id, @event.ProjectionVersionRequest.Version, result.Error);
             commandPublisher.Publish(cancel);
         }
     }
 }
Example #2
0
        public Task HandleAsync(ProjectionVersionRequestHeartbeat sagaTimeout)
        {
            var timedout = new TimeoutProjectionVersionRequest(sagaTimeout.ProjectionVersionRequest.Id, sagaTimeout.ProjectionVersionRequest.Version, sagaTimeout.ProjectionVersionRequest.Timebox);

            commandPublisher.Publish(timedout);

            return(Task.CompletedTask);
        }
 public Task HandleAsync(TimeoutProjectionVersionRequest command)
 {
     return(UpdateAsync(command.Id, ar => ar.VersionRequestTimedout(command.Version, command.Timebox)));
 }
Example #4
0
        public void Handle(ProjectionVersionRebuildTimedout sagaTimeout)
        {
            var timedout = new TimeoutProjectionVersionRequest(sagaTimeout.ProjectionVersionRequest.Id, sagaTimeout.ProjectionVersionRequest.ProjectionVersion, sagaTimeout.ProjectionVersionRequest.Timebox);

            CommandPublisher.Publish(timedout);
        }
 public void Handle(TimeoutProjectionVersionRequest command)
 {
     Update(command.Id, ar => ar.VersionRequestTimedout(command.Version, command.Timebox));
 }