Skip to content

Instantly share code, notes, and snippets.

@goosmurf
Created July 2, 2009 05:23
Show Gist options
  • Save goosmurf/139279 to your computer and use it in GitHub Desktop.
Save goosmurf/139279 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'beanstalk-client'
JOB_SIZE = 64000
beanstalk = Beanstalk::Connection.new('127.0.0.1:11300')
job_data = 'x' * JOB_SIZE
job_id = beanstalk.put(job_data)
bs_job = beanstalk.reserve
bs_job.bury
while true do
bs_job = beanstalk.peek_buried
#beanstalk.delete(bs_job.id)
puts bs_job.id
end
beanstalk.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment