DEV Community

Cover image for Code Reading of Sidekiq
Kenta Takeuchi
Kenta Takeuchi

Posted on • Originally published at bmf-tech.com

Code Reading of Sidekiq

This article was originally published on bmf-tech.com.

Overview

A quick read through the Sidekiq code.

Preparation

  1. Clone sidekiq
  2. Start redis
    • docker run --name redis-server -p 6379:6379 -d redis
  3. Insert binding.pry where you want to debug
  4. Start sidekiq
    • bundle exec sidekiq -r ./examples/blog.rb
  5. Enqueue a job
    • bundle exec irb -r ./examples/por.rb

Code Reading

Enqueuing Jobs

  1. Call asynchronous processing starting from perform_async
  2. Enqueue the job

Executing Jobs

  1. Start sidekiq
  2. Fetch jobs
  3. Execute the job

Top comments (0)