Skip to content

Instantly share code, notes, and snippets.

@tomlea
Created January 30, 2009 14:19
Show Gist options
  • Save tomlea/55082 to your computer and use it in GitHub Desktop.
Save tomlea/55082 to your computer and use it in GitHub Desktop.
Beanstalker is back, and it's hungry for beans!
#!/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