Class: EventMachine::DistributedNotificationWatch

Inherits:
Object
  • Object
show all
Defined in:
lib/eventmachine-distributed-notification.rb

Instance Method Summary collapse

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, )
end

#startObject



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

#stopObject



32
33
34
# File 'lib/eventmachine-distributed-notification.rb', line 32

def stop
  @timer.cancel if @timer
end