Sha256: 7763b9f08184d9bd4e487dc9850b2a7d2dfa5209b1480c35b18416e37549156c
Contents?: true
Size: 609 Bytes
Versions: 4
Compression:
Stored size: 609 Bytes
Contents
require 'active_support/notifications' module Phobos module Instrumentation NAMESPACE = 'phobos' def self.subscribe(event) ActiveSupport::Notifications.subscribe("#{NAMESPACE}.#{event}") do |*args| yield ActiveSupport::Notifications::Event.new(*args) if block_given? end end def self.unsubscribe(subscriber) ActiveSupport::Notifications.unsubscribe(subscriber) end def instrument(event, extra = {}) ActiveSupport::Notifications.instrument("#{NAMESPACE}.#{event}", extra) do |extra| yield(extra) if block_given? end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
phobos-1.8.0 | lib/phobos/instrumentation.rb |
phobos-1.7.2 | lib/phobos/instrumentation.rb |
phobos-1.7.1 | lib/phobos/instrumentation.rb |
phobos-1.7.0 | lib/phobos/instrumentation.rb |