Created
April 3, 2012 09:56
-
-
Save lowang/2290765 to your computer and use it in GitHub Desktop.
Torquebox 2.0.0 queue system performance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ruby: | |
| version: 1.9 | |
| queues: | |
| /queues/nondurable: | |
| durable: false | |
| /queues/durable: | |
| durable: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source 'http://rubygems.org' | |
| gem 'rack' | |
| gem 'activesupport' | |
| gem "torquebox", '2.0.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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