class RubyEventStore::InstrumentedSubscriptions
Attributes
Public Class Methods
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 5 def initialize(subscriptions, instrumentation) @subscriptions = subscriptions @instrumentation = instrumentation end
Public Instance Methods
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 16 def add_global_subscription(subscriber) instrument(subscriber: subscriber) { subscriptions.add_global_subscription(subscriber) } end
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 10 def add_subscription(subscriber, event_types) instrument(subscriber: subscriber, event_types: event_types) do subscriptions.add_subscription(subscriber, event_types) end end
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 26 def add_thread_global_subscription(subscriber) instrument(subscriber: subscriber) { subscriptions.add_thread_global_subscription(subscriber) } end
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 20 def add_thread_subscription(subscriber, event_types) instrument(subscriber: subscriber, event_types: event_types) do subscriptions.add_thread_subscription(subscriber, event_types) end end
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 30 def method_missing(method_name, *arguments, &block) if respond_to?(method_name) subscriptions.public_send(method_name, *arguments, &block) else super end end
Calls superclass method
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 38 def respond_to_missing?(method_name, _include_private) subscriptions.respond_to?(method_name) end
Private Instance Methods
Source
# File lib/ruby_event_store/instrumented_subscriptions.rb, line 44 def instrument(args) instrumentation.instrument("add.subscriptions.rails_event_store", args) do unsubscribe = yield -> { instrumentation.instrument("remove.subscriptions.rails_event_store", args) { unsubscribe.call } } end end