This is a module so that we can send messages from (for example) web page controllers, or can receive a single message
# File lib/activemessaging/message_sender.rb, line 8 def self.included(included_by) class << included_by def publishes_to destination_name ActiveMessaging::Gateway.find_destination(destination_name) end def receives_from destination_name ActiveMessaging::Gateway.find_destination(destination_name) end end end
# File lib/activemessaging/message_sender.rb, line 20 def publish destination_name, message, headers={}, timeout=10 ActiveMessaging::Gateway.publish(destination_name, message, self.class, headers, timeout) end
# File lib/activemessaging/test_helper.rb, line 39 def publish_with_reset(destination_name, message, headers={}, timeout=10) unless @@__a13g_initialized__ ActiveMessaging.reload_activemessaging @@__a13g_initialized__ = true end publish_without_reset(destination_name, message, headers, timeout) end
Generated with the Darkfish Rdoc Generator 2.