lib/emittance/emitter.rb in emittance-0.0.3 vs lib/emittance/emitter.rb in emittance-0.0.4

- old
+ new

@@ -60,30 +60,30 @@ # the payload. See {Emittance::Event} for more details. # @param broker [Symbol] the identifier for the broker you wish to handle the event. Requires additional gems # if not using the default. # # @return the payload - def emit(identifier, payload: nil, broker: :synchronous) + def emit(identifier, payload: nil) now = Time.now event_klass = _event_klass_for identifier event = event_klass.new(self, now, payload) - _send_to_broker event, broker + _send_to_broker event payload end # If you don't know the specific identifier whose event you want to emit, you can send it a bunch of stuff and # +Emitter+ will automatically generate an +Event+ class for you. # # @param identifiers [*] anything that can be used to generate an +Event+ class. # @param payload (@see #emit) # @param broker (@see #emit) - def emit_with_dynamic_identifier(*identifiers, payload:, broker: :synchronous) + def emit_with_dynamic_identifier(*identifiers, payload:) now = Time.now event_klass = _event_klass_for(*identifiers) event = event_klass.new(self, now, payload) - _send_to_broker event, broker + _send_to_broker event payload end # Tells the object to emit an event when a any of the given set of methods. By default, the event classes are @@ -129,11 +129,11 @@ def _event_klass_for(*identifiers) Emittance::Event.event_klass_for(*identifiers) end - def _send_to_broker(event, broker) - Emittance::Brokerage.send_event event, broker + def _send_to_broker(event) + Emittance::Brokerage.send_event event end end end end