Skip to content

Commit

Permalink
added Dummy Adapter for use in development
Browse files Browse the repository at this point in the history
  • Loading branch information
Rahoul Baruah committed Jun 24, 2009
1 parent 495f797 commit 0234bf5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
v0.8.5. Added dummy adapter for testing purposes
v0.8.4. Fix typo in 0.8.3
v0.8.3. Can now override WARREN_ENV from the command line.
v0.8.2. Added nice error message when no details for current env
Expand Down
12 changes: 12 additions & 0 deletions lib/warren/adapters/dummy_adapter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require "rubygems"

class DummyAdapter < Warren::Queue
def self.publish queue_name, payload, &blk
puts "publishing #{payload.inspect} to #{queue_name}"
end

def self.subscribe queue_name, &block
puts "subscribing to #{queue_name}"
end
end

4 changes: 3 additions & 1 deletion readme.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ Start by looking at examples/ to see how to use it, and then lib/warren/adapters

require "rubygems"
require "warren"
# Pull in the bunny adapter
# Use the bunny adapter to connect to RabbitMQ (Bunny is an AMQP client that works with Rails/Passenger apps)
require "warren/adapters/bunny_adapter"
# If you're running in development and don't want to actually push messages onto the queue then instead of loading the bunny adapter use the dummy adapter
require "warren/adapters/dummy_adapter"

# See examples/ for more

Expand Down

0 comments on commit 0234bf5

Please sign in to comment.