Reputation: 45941
Each worker should have it's own resource connection. I read the docs, but it wasn't clear if each thread runs a separate instance of the worker.
If so, does this create a connection that is unique to each worker?
class HardWorker
include Sidekiq::Worker
def perform
connection.send 'message'
end
def connection
@connection ||= Connection.new
end
end
Upvotes: 0
Views: 38
Reputation: 22238
Sidekiq basically does this when executing each job: HardWorker.new.perform
. So, yes.
Upvotes: 1