Class: Sidekiq::Embedded
Instance Attribute Summary
Attributes included from Component
#config
Instance Method Summary
collapse
Methods included from Component
#fire_event, #handle_exception, #hostname, #identity, #logger, #process_nonce, #redis, #safe_thread, #tid, #watchdog
Constructor Details
#initialize(config) ⇒ Embedded
Returns a new instance of Embedded.
9
10
11
|
# File 'lib/sidekiq/embedded.rb', line 9
def initialize(config)
@config = config
end
|
Instance Method Details
#quiet ⇒ Object
24
25
26
|
# File 'lib/sidekiq/embedded.rb', line 24
def quiet
@launcher&.quiet
end
|
#run ⇒ Object
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/sidekiq/embedded.rb', line 13
def run
housekeeping
fire_event(:startup, reverse: false, reraise: true)
@launcher = Sidekiq::Launcher.new(@config, embedded: true)
@launcher.run
sleep 0.2
logger.info "Sidekiq running embedded, total process thread count: #{Thread.list.size}"
logger.debug { Thread.list.map(&:name) }
end
|
#stop ⇒ Object
28
29
30
|
# File 'lib/sidekiq/embedded.rb', line 28
def stop
@launcher&.stop
end
|