lib/asynchronic/notifier/broadcaster.rb in asynchronic-3.0.3 vs lib/asynchronic/notifier/broadcaster.rb in asynchronic-4.0.0
- old
+ new
@@ -6,25 +6,29 @@
options[:logger] ||= Asynchronic.logger
@broadcaster = ::Broadcaster.new options
end
def publish(pid, event, data=nil)
- @broadcaster.publish DataStore::Key[pid][event], data
+ broadcaster.publish DataStore::Key[pid][event], data
end
def subscribe(pid, event, &block)
- @broadcaster.subscribe DataStore::Key[pid][event] do |data|
+ broadcaster.subscribe DataStore::Key[pid][event] do |data|
block.call data
end
end
def unsubscribe(subscription_id)
- @broadcaster.unsubscribe subscription_id
+ broadcaster.unsubscribe subscription_id
end
def unsubscribe_all
- @broadcaster.unsubscribe_all
+ broadcaster.unsubscribe_all
end
+
+ private
+
+ attr_reader :broadcaster
end
end
end
\ No newline at end of file