CARVIEW |
Select Language
HTTP/2 200
date: Sat, 19 Jul 2025 18:50:57 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"de2a97eefbc9b65fea539a2a22824060"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=IY8gWebqK1aufiR%2FWmmwl45udbheEopf%2B2ZvhkyXh2F1S5WdtSyVhblAtS9E3TmlVzYgYTly6x96m%2FjI%2F9eYjeIzN83cZdRIjvcSGf5j9LwWy6D9OonUmfbz%2B60d0M1tcYGSlgNhVwt%2BKVT5DObyNjU1Yyws81mdOZm4fObxI1%2FnaXpY5gkMWjh5sJqDNxov%2BGij%2FHEIUib%2FoMF5soI4LPHhvIKJjLHI3%2BCPRzKw8PpyhwfIR%2F2qkhCigBgGsEohOQawEinEhxdRjOpM6rGPrg%3D%3D--LX%2BKUDmyUC2KLYDz--NhtC3rLc26qS%2BfkRoklhyQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.73416521.1752951057; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 18:50:57 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 18:50:57 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C23E:10A6BA:79394F:981ACE:687BE911
Getting Started · sidekiq/sidekiq Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Getting Started
Mike Perham edited this page Mar 6, 2025
·
76 revisions
Sidekiq makes every effort to make usage with modern Rails applications as simple as possible. Please see the ActiveJob page if you want to use Sidekiq with ActiveJob.
- Add sidekiq to your Gemfile:
bundle add sidekiq
- Add these two lines to
config/routes.rb
:
require "sidekiq/web" # require the web UI
Rails.application.routes.draw do
mount Sidekiq::Web => "/sidekiq" # access it at https://localhost:3000/sidekiq
...
end
- Add a job class in
app/sidekiq
, run this command in your shell:
bin/rails generate sidekiq:job hard
class HardJob
include Sidekiq::Job
def perform(name, count)
# do something
end
end
Your perform
method arguments must be simple, basic types like String, integer, boolean that are supported by JSON. Complex Ruby objects will not work.
To namespace your hard
job in a rock
namespace:
rails generate sidekiq:job rock/hard
This will generate the following:
class Rock::HardJob
include Sidekiq::Job
def perform(*args)
# Do something
end
end
- Create a background job to be processed:
HardJob.perform_async('bob', 5)
Note that perform
is an instance method, whereas perform_async
is called on the class.
You can also create a job to be processed in the future:
HardJob.perform_in(5.minutes, 'bob', 5)
HardJob.perform_at(5.minutes.from_now, 'bob', 5)
Note: The 5.minutes
syntax is Rails-specific. If you are not using Rails, pass in a number representing seconds:
HardJob.perform_in(5*60, 'bob', 5)
- Start sidekiq from the root of your Rails application so the jobs will be processed:
bundle exec sidekiq
That's it.
por.rb
in examples/
is a "Plain Old Ruby" example.
Watch an overview:
Next: The Basics
Clone this wiki locally
You can’t perform that action at this time.