-
-
Save wpeterson/c5027d393bc54e202dab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Alpha < WorkerCommand | |
@queue = :alpha | |
def self.work | |
sleep(5) | |
puts "Alpha" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> rake resque:work QUEUE=alpha,beta | |
Beta | |
Beta | |
Beta | |
Alpha | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Beta < WorkerCommand | |
@queue = :beta | |
def self.work | |
sleep(5) | |
puts "Beta" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$> rake resque:work QUEUE=beta,alpha | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta | |
Beta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gemfile.lock:231: resque (1.19.0) | |
Gemfile.lock:236: resque-meta (1.0.3) | |
Gemfile.lock:237: resque (~> 1.8) | |
Gemfile.lock:238: resque-scheduler (1.9.9) | |
Gemfile.lock:240: resque (>= 1.8.0) | |
Gemfile.lock:242: resque_mailer (1.0.1) | |
Gemfile.lock:390: resque (= 1.19.0) | |
Gemfile.lock:391: resque-meta (= 1.0.3) | |
Gemfile.lock:392: resque-scheduler (= 1.9.9) | |
Gemfile.lock:393: resque_mailer (= 1.0.1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> 100.times { Resque.enqueue Beta } | |
=> 100 | |
# Wait for both workers to start processing Beta jobs on queue... | |
# Now add a high-priority Alpha job | |
>> Resque.enqueue Alpha | |
=> [] | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment