Esempio n. 1
0
 public LightWeightTimerTimeClass(LightWeightTimerScheduler scheduler, TimeSpan timeClassInterval)
 {
     _timers = new List <LightWeightTimer>();
     _watch  = new Stopwatch();
     _watch.Start();
     _scheduler = scheduler;
     Interval   = timeClassInterval;
 }
Esempio n. 2
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;
 }
Esempio n. 4
0
 internal LightWeightTimer(LightWeightTimerTimeClass timeClass,
                           LightWeightTimerScheduler scheduler)
 {
     TimeClass = timeClass;
     Scheduler = scheduler;
 }
Esempio n. 5
0
 public LightWeightTimerTimeClass(LightWeightTimerScheduler scheduler, TimeSpan timeClassInterval)
 {
     _timers = new List<LightWeightTimer>();
     _watch = new Stopwatch();
     _watch.Start();
     _scheduler = scheduler;
     Interval = timeClassInterval;
 }
Esempio n. 6
0
 internal LightWeightTimer(LightWeightTimerTimeClass timeClass,
     LightWeightTimerScheduler scheduler)
 {
     TimeClass = timeClass;
     Scheduler = scheduler;
 }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (TimerScheduler!= null)
         {
             TimerScheduler.Dispose();
             TimerScheduler = null;
         }
         if (_timerCheckChannelTimedOut != null)
         {
             _timerCheckChannelTimedOut.Dispose();
             _timerCheckChannelTimedOut = null;
         }
         if (_channels != null)
         {
             foreach (var item in _channels.Values)
                 item.Dispose();
             _channels = null;
         }
     }
 }