mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Sample bare application with no Rails
This commit is contained in:
parent
1d1e166fc0
commit
7afd4fdbab
3 changed files with 26 additions and 0 deletions
6
bare/Gemfile
Normal file
6
bare/Gemfile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "sidekiq", path: ".."
|
||||
gem "rackup"
|
||||
1
bare/boot.rb
Normal file
1
bare/boot.rb
Normal file
|
|
@ -0,0 +1 @@
|
|||
require "sidekiq/api"
|
||||
19
bare/simple.ru
Normal file
19
bare/simple.ru
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Easiest way to run Sidekiq::Web.
|
||||
# Run with "bundle exec rackup simple.ru"
|
||||
|
||||
require "sidekiq/web"
|
||||
|
||||
# A Web process always runs as client, no need to configure server
|
||||
Sidekiq.configure_client do |config|
|
||||
config.redis = {url: "redis://localhost:6379/0", size: 1}
|
||||
end
|
||||
|
||||
Sidekiq::Client.push("class" => "HardWorker", "args" => [])
|
||||
|
||||
# In a multi-process deployment, all Web UI instances should share
|
||||
# this secret key so they can all decode the encrypted browser cookies
|
||||
# and provide a working session.
|
||||
# Rails does this in /config/initializers/secret_token.rb
|
||||
secret_key = SecureRandom.hex(32)
|
||||
use Rack::Session::Cookie, secret: secret_key, same_site: true, max_age: 86400
|
||||
run Sidekiq::Web
|
||||
Loading…
Add table
Add a link
Reference in a new issue