Skip to content

Instantly share code, notes, and snippets.

@vanpelt
Created October 2, 2008 02:29
Show Gist options
  • Save vanpelt/14259 to your computer and use it in GitHub Desktop.
Save vanpelt/14259 to your computer and use it in GitHub Desktop.
popper = Proc.new do |headers, msg|
if msg == "empty!"
sleep 5
else
job = OpenStruct.new(:ybody => YAML.load(msg), :body => msg, :stats => [], :job_id => headers.properties[:delivery_tag])
safe_dispatch(job)
end
AsyncObserver::Queue.queue.pop &popper
end
AsyncObserver::Queue.queue.pop &popper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment