Skip to content
Browse files

Turd demonstrating TORQUE-333

  • Loading branch information...
1 parent 27d5c66 commit 8af12497fe80ced53fd1ea1142443f3fedc2e538 @jcrossley3 jcrossley3 committed Apr 6, 2011
Showing with 46 additions and 0 deletions.
  1. +2 −0 torque-333/Gemfile
  2. +10 −0 torque-333/Gemfile.lock
  3. +1 −0 torque-333/Rakefile
  4. +3 −0 torque-333/config.ru
  5. +9 −0 torque-333/my_handler.rb
  6. +14 −0 torque-333/rack_app.rb
  7. +7 −0 torque-333/torquebox.yml
View
2 torque-333/Gemfile
@@ -0,0 +1,2 @@
+source "http://rubygems.org"
+gem "rack"
View
10 torque-333/Gemfile.lock
@@ -0,0 +1,10 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ rack (1.2.2)
+
+PLATFORMS
+ java
+
+DEPENDENCIES
+ rack
View
1 torque-333/Rakefile
@@ -0,0 +1 @@
+require "torquebox-rake-support"
View
3 torque-333/config.ru
@@ -0,0 +1,3 @@
+require 'rack_app.rb'
+use Rack::Reloader
+run RackApp.new
View
9 torque-333/my_handler.rb
@@ -0,0 +1,9 @@
+require "torquebox-messaging"
+
+foo = Class::That:Dont::Exist
+
+class MyHandler < TorqueBox::Messaging::MessageProcessor
+ def on_message(body)
+ puts "#{body}"
+ end
+end
View
14 torque-333/rack_app.rb
@@ -0,0 +1,14 @@
+
+class RackApp
+ include TorqueBox::Injectors
+
+ def initialize
+ @queue = inject('/queues/testing')
+ end
+
+ def call(env)
+ @queue.publish(Time.now)
+ [200, {'Content-Type' => 'text/plain'}, "the response" ]
+ end
+end
+
View
7 torque-333/torquebox.yml
@@ -0,0 +1,7 @@
+queues:
+ /queues/testing:
+ durable: false
+
+messaging:
+ /queues/testing: MyHandler
+

0 comments on commit 8af1249

Please sign in to comment.
Something went wrong with that request. Please try again.