Sha256: 643f16fbde6aa77bc5ca745b13375b351925fd433293f5c934a9217a95fc975a
Contents?: true
Size: 850 Bytes
Versions: 33
Compression:
Stored size: 850 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware" module Renalware module Broadcasting include Wisper::Publisher extend ActiveSupport::Concern # Subscribes any listeners configured in Renalware.config.broadcast_subscription_map # to the current instance. # # Example usage # # class SomeServiceObject # include Broadcasting # # def call # .. # end # end # # SomeServiceObject.new(..).broadcasting_to_configured_subscribers.call(..) # # See https://github.com/krisleech/wisper # def broadcasting_to_configured_subscribers subscribers = Renalware.config.broadcast_subscription_map[self.class.name] Array(subscribers).each{ |listener| subscribe(listener.to_s.constantize.new) } self end end end
Version data entries
33 entries across 33 versions & 1 rubygems