Sha256: f1dfeed2ffa0020049c56ddc7efec26db8e65da3e1b1f86f7d2c6b7c0e3716c8

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 Bytes

Contents

# frozen_string_literal: true

module Emittance
  ##
  # Base class for event brokers.
  #
  class Broker
    class << self
      # @param _event [Emittance::Event] the event to be passed off to watchers
      def process_event(_event)
        raise NotImplementedError
      end

      def inherited(subklass)
        register_broker subklass
        super
      end

      def register_broker(broker)
        Emittance::Brokerage.register_broker broker
      end
    end
  end
end

require 'emittance/brokers/synchronous'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
emittance-0.0.3 lib/emittance/broker.rb
emittance-0.0.2 lib/emittance/broker.rb