This article was originally published on bmf-tech.com.
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_push -
push -
raw_push
-
Executing Jobs
- Start sidekiq
-
run -
launch -
run
-
- Fetch jobs
-
run -
process_one -
process- lib/sidekiq/processor.rb#159
- Process the job
-
- Execute the job
Top comments (0)