Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Expose `job_reservers` off of the worker instance.

It's useful in some specs I'm writing in our app to have access to this.
  • Loading branch information...
commit 90fd592b405225d673952a30b8d9d862c7c52ce5 1 parent dc4978a
@myronmarston myronmarston authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/qless/worker.rb
View
6 lib/qless/worker.rb
@@ -8,7 +8,7 @@ module Qless
# https://github.com/defunkt/resque/blob/v1.20.0/lib/resque/worker.rb
class Worker
def initialize(job_reserver, options = {})
- @job_reserver = job_reserver
+ self.job_reserver = job_reserver
@shutdown = @paused = false
self.very_verbose = options[:very_verbose]
@@ -35,6 +35,10 @@ def initialize(job_reserver, options = {})
# Defaults to $stdout.
attr_accessor :output
+ # The object responsible for reserving jobs from the Qless server,
+ # using some reasonable strategy (e.g. round robin or ordered)
+ attr_accessor :job_reserver
+
# Starts a worker based on ENV vars. Supported ENV vars:
# - REDIS_URL=redis://host:port/db-num (the redis gem uses this automatically)
# - QUEUES=high,medium,low or QUEUE=blah
Please sign in to comment.
Something went wrong with that request. Please try again.