Class: RequestTrail::Subscriber
- Inherits:
-
Object
- Object
- RequestTrail::Subscriber
- Defined in:
- lib/request_trail/subscriber.rb
Constant Summary collapse
- SQL_EVENT =
"sql.active_record"- CACHE_READ_EVENT =
"cache_read.active_support"- CACHE_WRITE_EVENT =
"cache_write.active_support"- ACTION_EVENT =
"process_action.action_controller"
Class Method Summary collapse
Class Method Details
.attach ⇒ Object
10 11 12 |
# File 'lib/request_trail/subscriber.rb', line 10 def self.attach @attach ||= [sql_subscription, cache_read_subscription, cache_write_subscription, action_subscription] end |
.detach ⇒ Object
14 15 16 17 18 19 |
# File 'lib/request_trail/subscriber.rb', line 14 def self.detach return unless @attach @attach&.each { |sub| ActiveSupport::Notifications.unsubscribe(sub) } @attach = nil end |