Skip to content

Instantly share code, notes, and snippets.

@vanpelt
Created October 1, 2008 19:58
Show Gist options
  • Save vanpelt/14174 to your computer and use it in GitHub Desktop.
Save vanpelt/14174 to your computer and use it in GitHub Desktop.
thin start --threaded
class GeneralController < ApplicationController
def queue_size
stuff = ""
cur = Thread.current
MQ.new.queue(params[:id] || 'crawls').status do |messages, consumers|
stuff = "#{messages} messages and #{consumers} consumers in #{params[:id] || 'crawls'}"
cur.wakeup
end
Thread.stop
render :text => stuff
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment