summaryrefslogtreecommitdiff
path: root/lib/infrastructure/threading/IntervalTimer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/infrastructure/threading/IntervalTimer.cs')
-rw-r--r--[-rwxr-xr-x]lib/infrastructure/threading/IntervalTimer.cs96
1 files changed, 48 insertions, 48 deletions
diff --git a/lib/infrastructure/threading/IntervalTimer.cs b/lib/infrastructure/threading/IntervalTimer.cs
index 3977978..74f3055 100755..100644
--- a/lib/infrastructure/threading/IntervalTimer.cs
+++ b/lib/infrastructure/threading/IntervalTimer.cs
@@ -1,48 +1,48 @@
-using System;
-using System.Collections.Generic;
-using gorilla.utility;
-
-namespace gorilla.infrastructure.threading
-{
- public class IntervalTimer : Timer
- {
- readonly ITimerFactory factory;
- readonly IDictionary<TimerClient, System.Timers.Timer> timers;
-
- public IntervalTimer() : this(new TimerFactory())
- {
- }
-
- public IntervalTimer(ITimerFactory factory)
- {
- this.factory = factory;
- timers = new Dictionary<TimerClient, System.Timers.Timer>();
- }
-
- public void start_notifying(TimerClient client_to_be_notified, TimeSpan span)
- {
- stop_notifying(client_to_be_notified);
-
- var timer = factory.create_for(span);
- timer.Elapsed += (o, e) =>
- {
- client_to_be_notified.notify();
- };
- timer.Start();
- timers[client_to_be_notified] = timer;
- }
-
- public void stop_notifying(TimerClient client_to_stop_notifying)
- {
- if (!timers.ContainsKey(client_to_stop_notifying)) return;
- timers[client_to_stop_notifying].Stop();
- timers[client_to_stop_notifying].Dispose();
- }
-
- public void Dispose()
- {
- timers.each(x => x.Value.Dispose());
- timers.Clear();
- }
- }
-} \ No newline at end of file
+using System;
+using System.Collections.Generic;
+using jive.utility;
+
+namespace jive.infrastructure.threading
+{
+ public class IntervalTimer : Timer
+ {
+ readonly ITimerFactory factory;
+ readonly IDictionary<TimerClient, System.Timers.Timer> timers;
+
+ public IntervalTimer() : this(new TimerFactory())
+ {
+ }
+
+ public IntervalTimer(ITimerFactory factory)
+ {
+ this.factory = factory;
+ timers = new Dictionary<TimerClient, System.Timers.Timer>();
+ }
+
+ public void start_notifying(TimerClient client_to_be_notified, TimeSpan span)
+ {
+ stop_notifying(client_to_be_notified);
+
+ var timer = factory.create_for(span);
+ timer.Elapsed += (o, e) =>
+ {
+ client_to_be_notified.notify();
+ };
+ timer.Start();
+ timers[client_to_be_notified] = timer;
+ }
+
+ public void stop_notifying(TimerClient client_to_stop_notifying)
+ {
+ if (!timers.ContainsKey(client_to_stop_notifying)) return;
+ timers[client_to_stop_notifying].Stop();
+ timers[client_to_stop_notifying].Dispose();
+ }
+
+ public void Dispose()
+ {
+ timers.each(x => x.Value.Dispose());
+ timers.Clear();
+ }
+ }
+}