Exemplo n.º 1
0
            private void InitOnEntry(Event e)
            {
                this.Config       = (TimerCountEvent)e;
                this.Config.Count = 0;

                // Start a regular timer.
                this.StartTimer(TimeSpan.FromMilliseconds(10));
            }
Exemplo n.º 2
0
 private void DoPing(Event e)
 {
     this.Config       = (TimerCountEvent)e;
     this.Config.Count = 0;
     this.PingTimer    = this.StartPeriodicTimer(TimeSpan.FromMilliseconds(5), TimeSpan.FromMilliseconds(5));
     this.StopTimer(this.PingTimer);
     this.RaiseGotoStateEvent <Pong>();
 }
Exemplo n.º 3
0
            private void InitOnEntry(Event e)
            {
                this.Config       = (TimerCountEvent)e;
                this.Config.Count = 0;

                // Start a periodic timer.
                this.Timer = this.StartPeriodicTimer(TimeSpan.FromMilliseconds(10), TimeSpan.FromMilliseconds(10));
            }
Exemplo n.º 4
0
            protected override Task OnInitializeAsync(Event initialEvent)
            {
                this.Config       = (TimerCountEvent)initialEvent;
                this.Config.Count = 0;

                // Start a regular timer.
                this.StartTimer(TimeSpan.FromMilliseconds(10));
                return(Task.CompletedTask);
            }
Exemplo n.º 5
0
        public void TestBasicTimerOperationInStateMachine()
        {
            var config = new TimerCountEvent();

            this.Test(r =>
            {
                r.CreateActor(typeof(M1), config);
            },
                      configuration: Configuration.Create().WithMaxSchedulingSteps(100).WithTimeoutDelay(1));
            Assert.True(config.Count > 0, "Timer never fired?");
        }
Exemplo n.º 6
0
        public void TestDropTimeoutsAfterTimerDisposal()
        {
            var config = new TimerCountEvent();

            this.Test(r =>
            {
                r.CreateActor(typeof(M3), config);
            },
                      configuration: Configuration.Create().WithMaxSchedulingSteps(100).WithTimeoutDelay(1));
            Assert.True(config.Count > 0, "Timer never fired?");
        }
Exemplo n.º 7
0
        public void TestBasicPeriodicTimerOperationInActor()
        {
            var config = new TimerCountEvent();

            this.Test(r =>
            {
                r.CreateActor(typeof(A2), config);
            },
                      configuration: Configuration.Create().WithTimeoutDelay(1));
            Assert.True(config.Count > 0, "Timer never fired?");
        }