Created
September 18, 2012 01:36
-
-
Save sdball/3740769 to your computer and use it in GitHub Desktop.
beanstalkd rollout!
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
$ ruby rollout.rb | |
$ stalk jobs.rb |
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
require 'stalker' | |
include Stalker | |
job 'autobots.transform' do |args| | |
autobot = args[:name] | |
puts "#{autobot}: chrkhekechk!" | |
end | |
error do |e, job, args| | |
puts "Call Wheeljack!" | |
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
require 'stalker' | |
1_000_000.times { |n| Stalker.enqueue('autobots.transform', {:name => "10101010#{n}"}) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For fun, start up the worker and then start up rollout.rb. Watch the queuing system race to stay ahead of the jobs!
For optimal watching experience: https://github.com/denniskuczynski/beanstalkd_view