Ejemplo n.º 1
0
        public ProcessActor(IProcess <TState> process, IProcessStateFactory <TState> processStateFactory)

        {
            Process  = process;
            Monitor  = new ActorMonitor(Context, "Process" + typeof(TState).Name);
            Behavior = new BehaviorQueue(Become);

            if (!EntityActorName.TryParseId(Self.Path.Name, out var id))
            {
                throw new BadNameFormatException();
            }

            Id = id;

            _publisher           = Context.System.GetTransport();
            _processStateFactory = processStateFactory;
            _log = Context.GetSeriLogger();

            _exceptionOnTransit  = ProcessManagerActorConstants.ExceptionOnTransit(Self.Path.Name);
            _producedCommand     = ProcessManagerActorConstants.ProcessProduceCommands(Self.Path.Name);
            _stateActorSelection = Context.System.ActorSelection(ProcessStateActorSelection);

            Behavior.Become(InitializingBehavior, nameof(InitializingBehavior));
        }
Ejemplo n.º 2
0
 public static ProcessScenario <TState> New <TState>(IProcess <TState> process,
                                                     IProcessStateFactory <TState> factory)
     where TState : class, IProcessState
 {
     return(new ProcessScenario <TState>(process, factory));
 }