sidekiq 5.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

Files changed (116) hide show
  1. checksums.yaml +7 -0
  2. data/.github/contributing.md +32 -0
  3. data/.github/issue_template.md +9 -0
  4. data/.gitignore +13 -0
  5. data/.travis.yml +18 -0
  6. data/3.0-Upgrade.md +70 -0
  7. data/4.0-Upgrade.md +53 -0
  8. data/5.0-Upgrade.md +56 -0
  9. data/COMM-LICENSE +95 -0
  10. data/Changes.md +1402 -0
  11. data/Ent-Changes.md +174 -0
  12. data/Gemfile +29 -0
  13. data/LICENSE +9 -0
  14. data/Pro-2.0-Upgrade.md +138 -0
  15. data/Pro-3.0-Upgrade.md +44 -0
  16. data/Pro-Changes.md +632 -0
  17. data/README.md +107 -0
  18. data/Rakefile +12 -0
  19. data/bin/sidekiq +18 -0
  20. data/bin/sidekiqctl +99 -0
  21. data/bin/sidekiqload +149 -0
  22. data/code_of_conduct.md +50 -0
  23. data/lib/generators/sidekiq/templates/worker.rb.erb +9 -0
  24. data/lib/generators/sidekiq/templates/worker_spec.rb.erb +6 -0
  25. data/lib/generators/sidekiq/templates/worker_test.rb.erb +8 -0
  26. data/lib/generators/sidekiq/worker_generator.rb +49 -0
  27. data/lib/sidekiq.rb +228 -0
  28. data/lib/sidekiq/api.rb +871 -0
  29. data/lib/sidekiq/cli.rb +413 -0
  30. data/lib/sidekiq/client.rb +238 -0
  31. data/lib/sidekiq/core_ext.rb +119 -0
  32. data/lib/sidekiq/delay.rb +21 -0
  33. data/lib/sidekiq/exception_handler.rb +31 -0
  34. data/lib/sidekiq/extensions/action_mailer.rb +57 -0
  35. data/lib/sidekiq/extensions/active_record.rb +40 -0
  36. data/lib/sidekiq/extensions/class_methods.rb +40 -0
  37. data/lib/sidekiq/extensions/generic_proxy.rb +31 -0
  38. data/lib/sidekiq/fetch.rb +81 -0
  39. data/lib/sidekiq/job_logger.rb +27 -0
  40. data/lib/sidekiq/job_retry.rb +235 -0
  41. data/lib/sidekiq/launcher.rb +167 -0
  42. data/lib/sidekiq/logging.rb +106 -0
  43. data/lib/sidekiq/manager.rb +138 -0
  44. data/lib/sidekiq/middleware/chain.rb +150 -0
  45. data/lib/sidekiq/middleware/i18n.rb +42 -0
  46. data/lib/sidekiq/middleware/server/active_record.rb +22 -0
  47. data/lib/sidekiq/paginator.rb +43 -0
  48. data/lib/sidekiq/processor.rb +238 -0
  49. data/lib/sidekiq/rails.rb +60 -0
  50. data/lib/sidekiq/redis_connection.rb +106 -0
  51. data/lib/sidekiq/scheduled.rb +147 -0
  52. data/lib/sidekiq/testing.rb +324 -0
  53. data/lib/sidekiq/testing/inline.rb +29 -0
  54. data/lib/sidekiq/util.rb +63 -0
  55. data/lib/sidekiq/version.rb +4 -0
  56. data/lib/sidekiq/web.rb +213 -0
  57. data/lib/sidekiq/web/action.rb +89 -0
  58. data/lib/sidekiq/web/application.rb +331 -0
  59. data/lib/sidekiq/web/helpers.rb +286 -0
  60. data/lib/sidekiq/web/router.rb +100 -0
  61. data/lib/sidekiq/worker.rb +144 -0
  62. data/sidekiq.gemspec +32 -0
  63. data/web/assets/images/favicon.ico +0 -0
  64. data/web/assets/images/logo.png +0 -0
  65. data/web/assets/images/status.png +0 -0
  66. data/web/assets/javascripts/application.js +92 -0
  67. data/web/assets/javascripts/dashboard.js +298 -0
  68. data/web/assets/stylesheets/application-rtl.css +246 -0
  69. data/web/assets/stylesheets/application.css +1111 -0
  70. data/web/assets/stylesheets/bootstrap-rtl.min.css +9 -0
  71. data/web/assets/stylesheets/bootstrap.css +5 -0
  72. data/web/locales/ar.yml +80 -0
  73. data/web/locales/cs.yml +78 -0
  74. data/web/locales/da.yml +68 -0
  75. data/web/locales/de.yml +69 -0
  76. data/web/locales/el.yml +68 -0
  77. data/web/locales/en.yml +79 -0
  78. data/web/locales/es.yml +69 -0
  79. data/web/locales/fa.yml +80 -0
  80. data/web/locales/fr.yml +78 -0
  81. data/web/locales/he.yml +79 -0
  82. data/web/locales/hi.yml +75 -0
  83. data/web/locales/it.yml +69 -0
  84. data/web/locales/ja.yml +78 -0
  85. data/web/locales/ko.yml +68 -0
  86. data/web/locales/nb.yml +77 -0
  87. data/web/locales/nl.yml +68 -0
  88. data/web/locales/pl.yml +59 -0
  89. data/web/locales/pt-br.yml +68 -0
  90. data/web/locales/pt.yml +67 -0
  91. data/web/locales/ru.yml +78 -0
  92. data/web/locales/sv.yml +68 -0
  93. data/web/locales/ta.yml +75 -0
  94. data/web/locales/uk.yml +76 -0
  95. data/web/locales/ur.yml +80 -0
  96. data/web/locales/zh-cn.yml +68 -0
  97. data/web/locales/zh-tw.yml +68 -0
  98. data/web/views/_footer.erb +17 -0
  99. data/web/views/_job_info.erb +88 -0
  100. data/web/views/_nav.erb +66 -0
  101. data/web/views/_paging.erb +23 -0
  102. data/web/views/_poll_link.erb +7 -0
  103. data/web/views/_status.erb +4 -0
  104. data/web/views/_summary.erb +40 -0
  105. data/web/views/busy.erb +94 -0
  106. data/web/views/dashboard.erb +75 -0
  107. data/web/views/dead.erb +34 -0
  108. data/web/views/layout.erb +40 -0
  109. data/web/views/morgue.erb +75 -0
  110. data/web/views/queue.erb +45 -0
  111. data/web/views/queues.erb +28 -0
  112. data/web/views/retries.erb +76 -0
  113. data/web/views/retry.erb +34 -0
  114. data/web/views/scheduled.erb +54 -0
  115. data/web/views/scheduled_job_info.erb +8 -0
  116. metadata +366 -0
@@ -0,0 +1,107 @@
1
+ Sidekiq
2
+ ==============
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/sidekiq.svg)](https://rubygems.org/gems/sidekiq)
5
+ [![Code Climate](https://codeclimate.com/github/mperham/sidekiq.svg)](https://codeclimate.com/github/mperham/sidekiq)
6
+ [![Build Status](https://travis-ci.org/mperham/sidekiq.svg)](https://travis-ci.org/mperham/sidekiq)
7
+ [![Gitter Chat](https://badges.gitter.im/mperham/sidekiq.svg)](https://gitter.im/mperham/sidekiq)
8
+
9
+
10
+ Simple, efficient background processing for Ruby.
11
+
12
+ Sidekiq uses threads to handle many jobs at the same time in the
13
+ same process. It does not require Rails but will integrate tightly with
14
+ Rails to make background processing dead simple.
15
+
16
+ Sidekiq is compatible with Resque. It uses the exact same
17
+ message format as Resque so it can integrate into an existing Resque processing farm.
18
+ You can have Sidekiq and Resque run side-by-side at the same time and
19
+ use the Resque client to enqueue jobs in Redis to be processed by Sidekiq.
20
+
21
+ Performance
22
+ ---------------
23
+
24
+ Version | Latency | Garbage created for 10,000 jobs | Time to process 100,000 jobs | Throughput
25
+ -----------------|------|---------|---------|------------------------
26
+ Sidekiq 4.0.0 | 10ms | 151 MB | 22 sec | **4500 jobs/sec**
27
+ Sidekiq 3.5.1 | 22ms | 1257 MB | 125 sec | 800 jobs/sec
28
+ Resque 1.25.2 | - | - | 420 sec | 240 jobs/sec
29
+ DelayedJob 4.1.1 | - | - | 465 sec | 215 jobs/sec
30
+
31
+
32
+ Requirements
33
+ -----------------
34
+
35
+ Sidekiq supports CRuby 2.2.2+ and JRuby 9k.
36
+
37
+ All Rails releases >= 4.0 are officially supported.
38
+
39
+ Redis 2.8 or greater is required. 3.0.3+ is recommended for large
40
+ installations with thousands of worker threads.
41
+
42
+
43
+ Installation
44
+ -----------------
45
+
46
+ gem install sidekiq
47
+
48
+
49
+ Getting Started
50
+ -----------------
51
+
52
+ See the [Getting Started wiki page](https://github.com/mperham/sidekiq/wiki/Getting-Started) and follow the simple setup process.
53
+ You can watch [this Youtube playlist](https://www.youtube.com/playlist?list=PLjeHh2LSCFrWGT5uVjUuFKAcrcj5kSai1) to learn all about
54
+ Sidekiq and see its features in action. Here's the Web UI:
55
+
56
+ ![Web UI](https://github.com/mperham/sidekiq/raw/master/examples/web-ui.png)
57
+
58
+
59
+ Want to Upgrade?
60
+ -------------------
61
+
62
+ I also sell Sidekiq Pro and Sidekiq Enterprise, extensions to Sidekiq which provide more
63
+ features, a commercial-friendly license and allow you to support high
64
+ quality open source development all at the same time. Please see the
65
+ [Sidekiq](http://sidekiq.org/) homepage for more detail.
66
+
67
+ Subscribe to the **[quarterly newsletter](https://tinyletter.com/sidekiq)** to stay informed about the latest
68
+ features and changes to Sidekiq and its bigger siblings.
69
+
70
+
71
+ Problems?
72
+ -----------------
73
+
74
+ **Please do not directly email any Sidekiq committers with questions or problems.** A community is best served when discussions are held in public.
75
+
76
+ If you have a problem, please review the [FAQ](https://github.com/mperham/sidekiq/wiki/FAQ) and [Troubleshooting](https://github.com/mperham/sidekiq/wiki/Problems-and-Troubleshooting) wiki pages.
77
+ Searching the [issues](https://github.com/mperham/sidekiq/issues) for your problem is also a good idea.
78
+
79
+ Useful resources:
80
+
81
+ * Product documentation is in the [wiki](https://github.com/mperham/sidekiq/wiki).
82
+ * Release announcements are made to the [@sidekiq](https://twitter.com/sidekiq) Twitter account.
83
+ * Here's a [Reddit forum](https://reddit.com/r/sidekiq) dedicated to Sidekiq discussion
84
+ * The [Sidekiq tag](https://stackoverflow.com/questions/tagged/sidekiq) on Stack Overflow has lots of useful Q & A.
85
+
86
+ **No support via Twitter, 140 characters is not enough.**
87
+
88
+ Every Friday morning is Sidekiq happy hour: I video chat and answer questions.
89
+ See the [Sidekiq support page](http://sidekiq.org/support) for details.
90
+
91
+ Thanks
92
+ -----------------
93
+
94
+ Sidekiq stays fast by using the [JProfiler java profiler](http://www.ej-technologies.com/products/jprofiler/overview.html) to find and fix
95
+ performance problems on JRuby. Unfortunately MRI does not have good multithreaded profiling tools.
96
+
97
+
98
+ License
99
+ -----------------
100
+
101
+ Please see [LICENSE](https://github.com/mperham/sidekiq/blob/master/LICENSE) for licensing details.
102
+
103
+
104
+ Author
105
+ -----------------
106
+
107
+ Mike Perham, [@mperham](https://twitter.com/mperham) / [@sidekiq](https://twitter.com/sidekiq), [http://www.mikeperham.com](http://www.mikeperham.com) / [http://www.contribsys.com](http://www.contribsys.com)
@@ -0,0 +1,12 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+ Rake::TestTask.new(:test) do |test|
4
+ test.warning = true
5
+ test.pattern = 'test/**/test_*.rb'
6
+ end
7
+
8
+ task :default => :test
9
+
10
+ task :appraise do
11
+ exec("cd myapp && rake appraise")
12
+ end
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Quiet some warnings we see when running in warning mode:
4
+ # RUBYOPT=-w bundle exec sidekiq
5
+ $TESTING = false
6
+
7
+ require_relative '../lib/sidekiq/cli'
8
+
9
+ begin
10
+ cli = Sidekiq::CLI.instance
11
+ cli.parse
12
+ cli.run
13
+ rescue => e
14
+ raise e if $DEBUG
15
+ STDERR.puts e.message
16
+ STDERR.puts e.backtrace.join("\n")
17
+ exit 1
18
+ end
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'fileutils'
4
+
5
+ class Sidekiqctl
6
+ DEFAULT_KILL_TIMEOUT = 10
7
+
8
+ attr_reader :stage, :pidfile, :kill_timeout
9
+
10
+ def self.print_usage
11
+ puts "#{File.basename($0)} - stop a Sidekiq process from the command line."
12
+ puts
13
+ puts "Usage: #{File.basename($0)} <command> <pidfile> <kill_timeout>"
14
+ puts " where <command> is either 'quiet' or 'stop'"
15
+ puts " <pidfile> is path to a pidfile"
16
+ puts " <kill_timeout> is number of seconds to wait until Sidekiq exits"
17
+ puts " (default: #{Sidekiqctl::DEFAULT_KILL_TIMEOUT}), after which Sidekiq will be KILL'd"
18
+ puts
19
+ puts "Be sure to set the kill_timeout LONGER than Sidekiq's -t timeout. If you want"
20
+ puts "to wait 60 seconds for jobs to finish, use `sidekiq -t 60` and `sidekiqctl stop"
21
+ puts " path_to_pidfile 61`"
22
+ puts
23
+ end
24
+
25
+ def initialize(stage, pidfile, timeout)
26
+ @stage = stage
27
+ @pidfile = pidfile
28
+ @kill_timeout = timeout
29
+
30
+ done('No pidfile given', :error) if !pidfile
31
+ done("Pidfile #{pidfile} does not exist", :warn) if !File.exist?(pidfile)
32
+ done('Invalid pidfile content', :error) if pid == 0
33
+
34
+ fetch_process
35
+
36
+ begin
37
+ send(stage)
38
+ rescue NoMethodError
39
+ done "Invalid command: #{stage}", :error
40
+ end
41
+ end
42
+
43
+ def fetch_process
44
+ Process.kill(0, pid)
45
+ rescue Errno::ESRCH
46
+ done "Process doesn't exist", :error
47
+ # We were not allowed to send a signal, but the process must have existed
48
+ # when Process.kill() was called.
49
+ rescue Errno::EPERM
50
+ return pid
51
+ end
52
+
53
+ def done(msg, error = nil)
54
+ puts msg
55
+ exit(exit_signal(error))
56
+ end
57
+
58
+ def exit_signal(error)
59
+ (error == :error) ? 1 : 0
60
+ end
61
+
62
+ def pid
63
+ @pid ||= File.read(pidfile).to_i
64
+ end
65
+
66
+ def quiet
67
+ `kill -TSTP #{pid}`
68
+ end
69
+
70
+ def stop
71
+ `kill -TERM #{pid}`
72
+ kill_timeout.times do
73
+ begin
74
+ Process.kill(0, pid)
75
+ rescue Errno::ESRCH
76
+ FileUtils.rm_f pidfile
77
+ done 'Sidekiq shut down gracefully.'
78
+ rescue Errno::EPERM
79
+ done 'Not permitted to shut down Sidekiq.'
80
+ end
81
+ sleep 1
82
+ end
83
+ `kill -9 #{pid}`
84
+ FileUtils.rm_f pidfile
85
+ done 'Sidekiq shut down forcefully.'
86
+ end
87
+ alias_method :shutdown, :stop
88
+ end
89
+
90
+ if ARGV.length < 2
91
+ Sidekiqctl.print_usage
92
+ else
93
+ stage = ARGV[0]
94
+ pidfile = ARGV[1]
95
+ timeout = ARGV[2].to_i
96
+ timeout = Sidekiqctl::DEFAULT_KILL_TIMEOUT if timeout == 0
97
+
98
+ Sidekiqctl.new(stage, pidfile, timeout)
99
+ end
@@ -0,0 +1,149 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Quiet some warnings we see when running in warning mode:
4
+ # RUBYOPT=-w bundle exec sidekiq
5
+ $TESTING = false
6
+
7
+ #require 'ruby-prof'
8
+ Bundler.require(:default)
9
+
10
+ require_relative '../lib/sidekiq/cli'
11
+ require_relative '../lib/sidekiq/launcher'
12
+
13
+ include Sidekiq::Util
14
+
15
+ Sidekiq.configure_server do |config|
16
+ #config.options[:concurrency] = 1
17
+ config.redis = { db: 13 }
18
+ config.options[:queues] << 'default'
19
+ config.logger.level = Logger::ERROR
20
+ config.average_scheduled_poll_interval = 2
21
+ config.reliable! if defined?(Sidekiq::Pro)
22
+ end
23
+
24
+ class LoadWorker
25
+ include Sidekiq::Worker
26
+ sidekiq_options retry: 1
27
+ sidekiq_retry_in do |x|
28
+ 1
29
+ end
30
+
31
+ def perform(idx)
32
+ #raise idx.to_s if idx % 100 == 1
33
+ end
34
+ end
35
+
36
+ # brew tap shopify/shopify
37
+ # brew install toxiproxy
38
+ # gem install toxiproxy
39
+ #require 'toxiproxy'
40
+ # simulate a non-localhost network for realer-world conditions.
41
+ # adding 1ms of network latency has an ENORMOUS impact on benchmarks
42
+ #Toxiproxy.populate([{
43
+ #"name": "redis",
44
+ #"listen": "127.0.0.1:6380",
45
+ #"upstream": "127.0.0.1:6379"
46
+ #}])
47
+
48
+ self_read, self_write = IO.pipe
49
+ %w(INT TERM TSTP TTIN).each do |sig|
50
+ begin
51
+ trap sig do
52
+ self_write.puts(sig)
53
+ end
54
+ rescue ArgumentError
55
+ puts "Signal #{sig} not supported"
56
+ end
57
+ end
58
+
59
+ Sidekiq.redis {|c| c.flushdb}
60
+ def handle_signal(launcher, sig)
61
+ Sidekiq.logger.debug "Got #{sig} signal"
62
+ case sig
63
+ when 'INT'
64
+ # Handle Ctrl-C in JRuby like MRI
65
+ # http://jira.codehaus.org/browse/JRUBY-4637
66
+ raise Interrupt
67
+ when 'TERM'
68
+ # Heroku sends TERM and then waits 10 seconds for process to exit.
69
+ raise Interrupt
70
+ when 'TSTP'
71
+ Sidekiq.logger.info "Received TSTP, no longer accepting new work"
72
+ launcher.quiet
73
+ when 'TTIN'
74
+ Thread.list.each do |thread|
75
+ Sidekiq.logger.warn "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"
76
+ if thread.backtrace
77
+ Sidekiq.logger.warn thread.backtrace.join("\n")
78
+ else
79
+ Sidekiq.logger.warn "<no backtrace available>"
80
+ end
81
+ end
82
+ end
83
+ end
84
+
85
+ def Process.rss
86
+ `ps -o rss= -p #{Process.pid}`.chomp.to_i
87
+ end
88
+
89
+ iter = 10
90
+ count = 10_000
91
+
92
+ iter.times do
93
+ arr = Array.new(count) do
94
+ []
95
+ end
96
+ count.times do |idx|
97
+ arr[idx][0] = idx
98
+ end
99
+ Sidekiq::Client.push_bulk('class' => LoadWorker, 'args' => arr)
100
+ end
101
+ Sidekiq.logger.error "Created #{count*iter} jobs"
102
+
103
+ Monitoring = Thread.new do
104
+ watchdog("monitor thread") do
105
+ while true
106
+ sleep 1
107
+ qsize, retries = Sidekiq.redis do |conn|
108
+ conn.pipelined do
109
+ conn.llen "queue:default"
110
+ conn.zcard "retry"
111
+ end
112
+ end.map(&:to_i)
113
+ total = qsize + retries
114
+ #GC.start
115
+ Sidekiq.logger.error("RSS: #{Process.rss} Pending: #{total}")
116
+ if total == 0
117
+ Sidekiq.logger.error("Done")
118
+ exit(0)
119
+ end
120
+ end
121
+ end
122
+ end
123
+
124
+ begin
125
+ #RubyProf::exclude_threads = [ Monitoring ]
126
+ #RubyProf.start
127
+ fire_event(:startup)
128
+ #Sidekiq.logger.error "Simulating 1ms of latency between Sidekiq and redis"
129
+ #Toxiproxy[:redis].downstream(:latency, latency: 1).apply do
130
+ launcher = Sidekiq::Launcher.new(Sidekiq.options)
131
+ launcher.run
132
+
133
+ while readable_io = IO.select([self_read])
134
+ signal = readable_io.first[0].gets.strip
135
+ handle_signal(launcher, signal)
136
+ end
137
+ #end
138
+ rescue SystemExit => e
139
+ #Sidekiq.logger.error("Profiling...")
140
+ #result = RubyProf.stop
141
+ #printer = RubyProf::GraphHtmlPrinter.new(result)
142
+ #printer.print(File.new("output.html", "w"), :min_percent => 1)
143
+ # normal
144
+ rescue => e
145
+ raise e if $DEBUG
146
+ STDERR.puts e.message
147
+ STDERR.puts e.backtrace.join("\n")
148
+ exit 1
149
+ end
@@ -0,0 +1,50 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This Code of Conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting the project maintainer at mperham AT gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+
45
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
46
+ version 1.3.0, available at
47
+ [http://contributor-covenant.org/version/1/3/0/][version]
48
+
49
+ [homepage]: http://contributor-covenant.org
50
+ [version]: http://contributor-covenant.org/version/1/3/0/
@@ -0,0 +1,9 @@
1
+ <% module_namespacing do -%>
2
+ class <%= class_name %>Worker
3
+ include Sidekiq::Worker
4
+
5
+ def perform(*args)
6
+ # Do something
7
+ end
8
+ end
9
+ <% end -%>