Created
May 9, 2014 19:42
-
-
Save kml/1e4a6b2812f416fce6cd to your computer and use it in GitHub Desktop.
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 'torquebox/messaging' | |
require 'torquebox/messaging/connection_factory' | |
require 'torquebox/messaging/destination' | |
module TorqueBox | |
module Messaging | |
class Destination | |
def publish_each(messages, options = {}) | |
wait_for_destination(options[:startup_timeout]) do | |
with_session(options) do |session| | |
messages.each do |message| | |
message_options = options.dup | |
yield message, message_options if block_given? | |
session.publish self, message, normalize_options(message_options) | |
end | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment