Class: EventMachine::DistributedNotificationWatch
- Inherits:
-
Object
- Object
- EventMachine::DistributedNotificationWatch
- Defined in:
- lib/eventmachine-distributed-notification.rb
Instance Method Summary collapse
-
#initialize(name) ⇒ DistributedNotificationWatch
constructor
A new instance of DistributedNotificationWatch.
- #notify(name, user_info) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(name) ⇒ DistributedNotificationWatch
Returns a new instance of DistributedNotificationWatch.
19 20 21 |
# File 'lib/eventmachine-distributed-notification.rb', line 19 def initialize(name) @observer = DistributedNotification::ObserverNative.new(name, self) end |
Instance Method Details
#notify(name, user_info) ⇒ Object
23 24 |
# File 'lib/eventmachine-distributed-notification.rb', line 23 def notify(name, user_info) end |
#start ⇒ Object
26 27 28 29 30 |
# File 'lib/eventmachine-distributed-notification.rb', line 26 def start @timer = EventMachine::add_periodic_timer(1) do @observer.run end end |
#stop ⇒ Object
32 33 34 |
# File 'lib/eventmachine-distributed-notification.rb', line 32 def stop @timer.cancel if @timer end |