Class: RubyEventStore::InstrumentedDispatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_event_store/instrumented_dispatcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(dispatcher, instrumentation) ⇒ InstrumentedDispatcher

Returns a new instance of InstrumentedDispatcher.


7
8
9
10
# File 'lib/ruby_event_store/instrumented_dispatcher.rb', line 7

def initialize(dispatcher, instrumentation)
  @dispatcher = dispatcher
  @instrumentation = instrumentation
end

Instance Method Details

#call(subscriber, event, record) ⇒ Object


12
13
14
15
16
# File 'lib/ruby_event_store/instrumented_dispatcher.rb', line 12

def call(subscriber, event, record)
  instrumentation.instrument("call.dispatcher.rails_event_store", event: event, subscriber: subscriber) do
    dispatcher.call(subscriber, event, record)
  end
end

#respond_to_missing?(method_name, _include_private) ⇒ Boolean

Returns:

  • (Boolean)

26
27
28
# File 'lib/ruby_event_store/instrumented_dispatcher.rb', line 26

def respond_to_missing?(method_name, _include_private)
  dispatcher.respond_to?(method_name)
end