Skip to content

Instantly share code, notes, and snippets.

@lowang
Created April 3, 2012 09:56
Show Gist options
  • Save lowang/2290765 to your computer and use it in GitHub Desktop.
Save lowang/2290765 to your computer and use it in GitHub Desktop.
Torquebox 2.0.0 queue system performance
require 'rubygems'
require 'bundler'
Bundler.setup
require 'active_support/all'
require 'benchmark'
require 'lib/qtest'
app = lambda {|env| [200, { 'Content-Type' => 'text/html' }, 'Hello World2'] }
run app
ruby:
version: 1.9
queues:
/queues/nondurable:
durable: false
/queues/durable:
durable: true
source 'http://rubygems.org'
gem 'rack'
gem 'activesupport'
gem "torquebox", '2.0.0'
class Qtest
include TorqueBox::Injectors
def initialize(is_durable)
if is_durable
@q = inject('/queues/durable')
else
@q = inject('/queues/nondurable')
end
end
def publish(options={})
@q.publish({ :body => Time.now }, options)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment