Module: Celluloid::Notifications

Included in:
IncidentReporter, Probe
Defined in:
lib/celluloid/notifications.rb

Defined Under Namespace

Classes: Fanout, Subscriber

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.notifierObject


3
4
5
# File 'lib/celluloid/notifications.rb', line 3

def self.notifier
  Actor[:notifications_fanout] or raise DeadActorError, "notifications fanout actor not running"
end

Instance Method Details

#publish(pattern, *args) ⇒ Object


7
8
9
# File 'lib/celluloid/notifications.rb', line 7

def publish(pattern, *args)
  Celluloid::Notifications.notifier.publish(pattern, *args)
end

#subscribe(pattern, method) ⇒ Object


11
12
13
# File 'lib/celluloid/notifications.rb', line 11

def subscribe(pattern, method)
  Celluloid::Notifications.notifier.subscribe(Actor.current, pattern, method)
end

#unsubscribe(*args) ⇒ Object


15
16
17
# File 'lib/celluloid/notifications.rb', line 15

def unsubscribe(*args)
  Celluloid::Notifications.notifier.unsubscribe(*args)
end