Module: EventMachine

Defined in:
lib/eventmachine-distributed-notification.rb,
lib/eventmachine-distributed-notification/version.rb

Defined Under Namespace

Modules: DistributedNotification Classes: DistributedNotificationWatch

Class Method Summary collapse

Class Method Details

.post_distributed_notification(name, data) ⇒ Object



53
54
55
# File 'lib/eventmachine-distributed-notification.rb', line 53

def self.post_distributed_notification(name, data)
  DistributedNotification::Poster.new.post(name, data)
end

.watch_distributed_notification(name, handler = nil, *args, &block) ⇒ Object



44
45
46
47
48
49
50
51
# File 'lib/eventmachine-distributed-notification.rb', line 44

def self.watch_distributed_notification(name, handler = nil, *args, &block)
  args = [name, *args]
  klass = klass_from_handler(EventMachine::DistributedNotificationWatch, handler, *args);
  c = klass.new(*args, &block)
  block_given? and yield c
  c.start
  c
end