Skip to content

Instantly share code, notes, and snippets.

@sdball
Created Sep 18, 2012
Embed
What would you like to do?
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