Skip to content

Instantly share code, notes, and snippets.

@sdball
Created September 18, 2012 01:36
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sdball/3740769 to your computer and use it in GitHub Desktop.
beanstalkd rollout!
$ ruby rollout.rb
$ stalk jobs.rb
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
require 'stalker'
1_000_000.times { |n| Stalker.enqueue('autobots.transform', {:name => "10101010#{n}"}) }
@sdball
Copy link
Author

sdball commented Sep 18, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment