public void OnStart(StartRequest request) { var pipelineName = string.IsNullOrEmpty(_requirements.PipelineConfiguration.Name) ? ActionPipelineManager.Name : _requirements.PipelineConfiguration.Name; _actionPipeline = Context.ActorOf(ActionPipelineManager.Props(_requirements), pipelineName); if (request.WithRecovery) { _actionPipeline.Tell(RecoveryRequest.New()); } _state = ActionProcessorState.Started; Sender.Tell(new Response(_state.ToString(), request)); }
private void OnRecoveryRequest(RecoveryRequest request) { var pendingRequests = _requirements.RequestPersistence.GetPendingRequests(); foreach (IActionRequest pendingRequest in pendingRequests) { if (pendingRequest is IRequestWithContext) { var contextRequest = pendingRequest as IRequestWithContext; var user = new ActionProcessorUser(_requirements.Authorisation, _requirements.Authorisation?.SystemUserName); var context = new ActionRequestContext(user, Self, pendingRequest as IActionRequest, null, null); contextRequest.InitialiseContext(context); } Self.Tell(pendingRequest.FlagForRecovery()); } }