コード例 #1
0
 public TimerAction(ISchedulerRegistry registry, Action action, long firstIntervalInMs, long intervalInMs)
 {
     this._registry          = registry;
     this._action            = action;
     this._firstIntervalInMs = firstIntervalInMs;
     this._intervalInMs      = intervalInMs;
 }
コード例 #2
0
ファイル: TimerAction.cs プロジェクト: OneOfBestMan/nami
 public TimerAction(ISchedulerRegistry scheduler, Action action, long firstIntervalInMs, long intervalInMs)
 {
     _scheduler         = scheduler;
     _action            = action;
     _firstIntervalInMs = firstIntervalInMs;
     _intervalInMs      = intervalInMs;
 }
コード例 #3
0
 // Methods
 public void ExecuteOnTimerThread(ISchedulerRegistry registry)
 {
     if (_intervalInMs == Timeout.Infinite || _cancelled)
     {
         registry.Remove(this);
         if (_timer != null)
         {
             _timer.Dispose();
             _timer = null;
         }
     }
     if (!_cancelled)
     {
         registry.Enqueue(ExecuteOnFiberThread);
     }
 }
コード例 #4
0
ファイル: TimerAction.cs プロジェクト: huangyingwen/retlang-1
        public void ExecuteOnTimerThread(ISchedulerRegistry registry)
        {
            if (_intervalInMs == Timeout.Infinite || _cancelled)
            {
                registry.Remove(this);
                if (_timer != null)
                {
                    _timer.Dispose();
                    _timer = null;
                }
            }

            if (!_cancelled)
            {
                registry.Enqueue(ExecuteOnFiberThread);
            }
        }
コード例 #5
0
 public void Schedule(ISchedulerRegistry registry)
 {
     _timer = new Timer(x => ExecuteOnTimerThread(registry), null, _firstIntervalInMs, _intervalInMs);
 }
コード例 #6
0
ファイル: TimerAction.cs プロジェクト: huangyingwen/retlang-1
 public void Schedule(ISchedulerRegistry registry)
 {
     _timer = new Timer(x => ExecuteOnTimerThread(registry), null, _firstIntervalInMs, _intervalInMs);
 }