Created
January 30, 2009 14:19
-
-
Save tomlea/55082 to your computer and use it in GitHub Desktop.
Beanstalker is back, and it's hungry for beans!
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
#!/usr/bin/env ruby | |
require "rubygems" | |
gem "beanstalk-client" | |
require "beanstalk-client" | |
port = ARGV.last or raise "GIVE ME A PORT NEXT TIME!" | |
beanstalk = Beanstalk::Pool.new(["0.0.0.0:#{port}"]) | |
puts "I'm going to kill all you mother f*%^&ers!" | |
puts "Are you sure?" | |
unless STDIN.gets =~ /^y/i | |
puts "Summon me again and it will be you that gets nuked! Biatch!" | |
exit | |
end | |
while(job = beanstalk.reserve) | |
job.delete | |
puts "BANG! and the task has gone!" | |
end | |
puts "No more beans, I'm going home." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment