Ejemplo n.º 1
0
 public ProcessTransited(IReadOnlyCollection <ICommand> producedCommands,
                         IMessageMetadata metadata,
                         ProcessEntry procesTransitEntry,
                         IProcessState newProcessState) : base(producedCommands, metadata)
 {
     ProcessTransitEntry = procesTransitEntry;
     NewProcessState     = newProcessState;
 }
Ejemplo n.º 2
0
        public void ExecuteSingleSaveStateTest(Func <IProcessState> a_prepereProcessStateMethod, string a_expectedState)
        {
            IProcessState processState = a_prepereProcessStateMethod();

            processState.Save();
            Console.WriteLine(processState.CurrentState);
            Assert.AreEqual(processState.CurrentState, a_expectedState);
        }
Ejemplo n.º 3
0
        public BaseMinerModelEx()
        {
            _processHelper        = null;
            RestartCnt            = 0;
            ForClientMineSeconds  = 0;
            ForAuthorMineSeconds  = 0;
            LastSwitchMineSeconds = 0;


            currentState   = new IDLEState();
            timer          = new System.Timers.Timer();
            timer.Interval = 1000;

            timer.Elapsed += Timer_Elapsed;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 1. Stan Startowy
        /// 2. Edit()
        /// 3. Save()
        /// 4. Clear()
        /// </summary>
        /// <param name="a_prepereProcessStateMethod"></param>
        /// <param name="a_arrExpectedState"></param>
        public void ExecuteStateTest(Func <IProcessState> a_prepereProcessStateMethod, params string[] a_arrExpectedState)
        {
            IProcessState processState = a_prepereProcessStateMethod();

            Console.WriteLine(processState.CurrentState);
            Assert.AreEqual(processState.CurrentState, a_arrExpectedState[0]);

            processState.Edit();
            Console.WriteLine(processState.CurrentState);
            Assert.AreEqual(processState.CurrentState, a_arrExpectedState[1]);

            processState = a_prepereProcessStateMethod();

            processState.Save();
            Console.WriteLine(processState.CurrentState);
            Assert.AreEqual(processState.CurrentState, a_arrExpectedState[2]);

            processState = a_prepereProcessStateMethod();

            processState.Clear();
            Console.WriteLine(processState.CurrentState);
            Assert.AreEqual(processState.CurrentState, a_arrExpectedState[3]);
        }
Ejemplo n.º 5
0
 public void Stop()
 {
     ProcessState = ProcessState.Stop(StopCallback);
 }
Ejemplo n.º 6
0
 public void Start()
 {
     ProcessState = ProcessState.Start(StartCallback);
 }
Ejemplo n.º 7
0
 public Process()
 {
     ProcessState = new Stopped();
 }
Ejemplo n.º 8
0
 public void SaveProcess(IProcessState process)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 9
0
 public UpdateProcessState(IProcessState <TEntity> state, IStateCommandInfo processInfo, ISystemProcess process, ISystemSource source) : base(processInfo, process, source)
 {
     State = state;
 }
Ejemplo n.º 10
0
 public ProcessAlreadyStartedException(IProcessState existingState, object startMessage)
 {
     StartMessage  = startMessage;
     ExistingState = existingState;
 }
Ejemplo n.º 11
0
 public void SaveProcess(IProcessState process)
 {
     Execute(() => _stateManagerImplementation.SaveProcess(process));
 }
Ejemplo n.º 12
0
 public static bool IsExecuting(this IProcessState process)
 {
     return(!(process.IsFinished || process.IsStopped) && process.StartTime.HasValue && process.IsVolumeGenerated);
 }
 public WorkProcessorsConfigurator(IProcessState workProcessor, ProtoregSerializer protoregSerializer, int conccurentNumberOfProcessors = 0)
 {
     this.workProcessor = workProcessor;
     this.conccurentNumberOfProcessors = conccurentNumberOfProcessors;
     massTransitSerializer = new MassTransitSerializer(protoregSerializer);
 }