module Celluloid::Notifications

Public Class Methods

notifier() click to toggle source
# File lib/celluloid/notifications.rb, line 3
def self.notifier
  Actor[:notifications_fanout] || fail(DeadActorError, "notifications fanout actor not running")
end
publish(pattern, *args) click to toggle source
# File lib/celluloid/notifications.rb, line 7
def publish(pattern, *args)
  Celluloid::Notifications.notifier.publish(pattern, *args)
rescue DeadActorError
  # Bad shutdown logic. Oh well....
  # TODO: needs a tests
end

Public Instance Methods

subscribe(pattern, method) click to toggle source
# File lib/celluloid/notifications.rb, line 16
def subscribe(pattern, method)
  Celluloid::Notifications.notifier.subscribe(Actor.current, pattern, method)
end
unsubscribe(*args) click to toggle source
# File lib/celluloid/notifications.rb, line 20
def unsubscribe(*args)
  Celluloid::Notifications.notifier.unsubscribe(*args)
end

Private Instance Methods

publish(pattern, *args) click to toggle source
# File lib/celluloid/notifications.rb, line 7
def publish(pattern, *args)
  Celluloid::Notifications.notifier.publish(pattern, *args)
rescue DeadActorError
  # Bad shutdown logic. Oh well....
  # TODO: needs a tests
end