Class: RubyEventStore::InstrumentedSubscriptions
- Inherits:
-
Object
- Object
- RubyEventStore::InstrumentedSubscriptions
show all
- Defined in:
- lib/ruby_event_store/instrumented_subscriptions.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of InstrumentedSubscriptions.
5
6
7
8
|
# File 'lib/ruby_event_store/instrumented_subscriptions.rb', line 5
def initialize(subscriptions, instrumentation)
@subscriptions = subscriptions
@instrumentation = instrumentation
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
30
31
32
33
34
35
36
|
# 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
|
Instance Method Details
#add_global_subscription(subscriber) ⇒ Object
16
17
18
|
# File 'lib/ruby_event_store/instrumented_subscriptions.rb', line 16
def add_global_subscription(subscriber)
instrument(subscriber: subscriber) { subscriptions.add_global_subscription(subscriber) }
end
|
#add_subscription(subscriber, event_types) ⇒ Object
10
11
12
13
14
|
# 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
|
#add_thread_global_subscription(subscriber) ⇒ Object
26
27
28
|
# 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
|
#add_thread_subscription(subscriber, event_types) ⇒ Object
20
21
22
23
24
|
# 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
|
#respond_to_missing?(method_name, _include_private) ⇒ Boolean
38
39
40
|
# File 'lib/ruby_event_store/instrumented_subscriptions.rb', line 38
def respond_to_missing?(method_name, _include_private)
subscriptions.respond_to?(method_name)
end
|