Class: ActiveJob::QueueAdapters::BackgroundThreadAdapter::LogSubscriber

Inherits:
ActiveSupport::LogSubscriber
  • Object
show all
Defined in:
lib/autoload/active_job/queue_adapters/background_thread_adapter.rb

Instance Method Summary collapse

Instance Method Details

#enqueue(event) ⇒ Object


188
189
190
191
192
# File 'lib/autoload/active_job/queue_adapters/background_thread_adapter.rb', line 188

def enqueue(event)
  message = "[Background Thread] Enqueued job: #{event.payload[:job]}, "\
            "call stack:\n#{event.payload[:caller][20..-1].join("\n")}"
  debug(message)
end

#grow(event) ⇒ Object


194
195
196
197
198
# File 'lib/autoload/active_job/queue_adapters/background_thread_adapter.rb', line 194

def grow(event)
  message = "[Background Thread] New thread: #{event.payload[:thread].object_id}, " +
            pool_statistics(event)
  info(message)
end

#shrink(event) ⇒ Object


200
201
202
203
204
# File 'lib/autoload/active_job/queue_adapters/background_thread_adapter.rb', line 200

def shrink(event)
  message = "[Background Thread] Stopping thread: #{event.payload[:thread].object_id}, " +
            pool_statistics(event)
  info(message)
end