Overview
A quick read through the Sidekiq code.
Preparation
- Clone sidekiq
- Start redis
docker run --name redis-server -p 6379:6379 -d redis
- Insert
binding.prywhere you want to debug - Start sidekiq
bundle exec sidekiq -r ./examples/blog.rb
- Enqueue a job
bundle exec irb -r ./examples/por.rb
Code Reading
Enqueuing Jobs
- Call asynchronous processing starting from
perform_async - Enqueue the job
client_pushpushraw_push
Executing Jobs
- Start sidekiq
runlaunchrun
- Fetch jobs
runprocess_oneprocess- lib/sidekiq/processor.rb#159
- Process the job
- lib/sidekiq/processor.rb#159
- Execute the job