Sha256: a24e00d682d108f7f0dfb6ac1f7eb049cff4c5d2e78c26ca7aaf0eb9ff88afd4
Contents?: true
Size: 943 Bytes
Versions: 42
Compression:
Stored size: 943 Bytes
Contents
module ActionSubscriber module Middleware class Router INSTRUMENT_KEY = "process_event.action_subscriber".freeze include ::ActionSubscriber::Logging def initialize(app) @app = app end def call(env) action = env.action message_id = env.message_id queue = env.queue routing_key = env.routing_key subscriber = env.subscriber logger.info { "START #{message_id} #{subscriber}##{action}" } instrument_call(subscriber, routing_key, queue) do subscriber.run_action_with_filters(env, action) end logger.info { "FINISHED #{message_id}" } end private def instrument_call(subscriber, routing_key, queue) ::ActiveSupport::Notifications.instrument INSTRUMENT_KEY, :subscriber => subscriber.to_s, :routing_key => routing_key, :queue => queue do yield end end end end end
Version data entries
42 entries across 42 versions & 1 rubygems