AllocateTimer() public method

public AllocateTimer ( System.TimeSpan interval ) : LightWeightTimer
interval System.TimeSpan
return LightWeightTimer
示例#1
0
 public WoopsaSubscriptionServiceImplementation(WoopsaContainer root, bool isServerSide)
 {
     _root                   = root;
     _isServerSide           = isServerSide;
     _channels               = new Dictionary <int, WoopsaSubscriptionChannel>();
     TimerScheduler          = new LightWeightTimerScheduler();
     TimerScheduler.Started += (sender, e) =>
     {
         _currentService = this;
     };
     TimerScheduler.Start();
     _timerCheckChannelTimedOut = TimerScheduler.AllocateTimer(
         WoopsaSubscriptionServiceConst.SubscriptionChannelLifeTimeCheckInterval);
     _timerCheckChannelTimedOut.Elapsed  += _timerCheckChannelTimedOut_Elapsed;
     _timerCheckChannelTimedOut.IsEnabled = true;
 }
 public WoopsaSubscriptionServiceImplementation(WoopsaContainer root, bool isServerSide)
 {
     _root = root;
     _isServerSide = isServerSide;
     _channels = new Dictionary<int, WoopsaSubscriptionChannel>();
     TimerScheduler = new LightWeightTimerScheduler();
     TimerScheduler.Started += (sender, e) =>
      {
          _currentService = this;
      };
     TimerScheduler.Start();
     _timerCheckChannelTimedOut = TimerScheduler.AllocateTimer(
         WoopsaSubscriptionServiceConst.SubscriptionChannelLifeTimeCheckInterval);
     _timerCheckChannelTimedOut.Elapsed += _timerCheckChannelTimedOut_Elapsed;
     _timerCheckChannelTimedOut.IsEnabled = true;
 }