Skip to content

Instantly share code, notes, and snippets.

@kml
Created May 9, 2014 19:42
Show Gist options
  • Save kml/1e4a6b2812f416fce6cd to your computer and use it in GitHub Desktop.
Save kml/1e4a6b2812f416fce6cd to your computer and use it in GitHub Desktop.
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