module ActiveMessaging

  # This is a module so that we can send messages from (for example) web page controllers, or can receive a single message
  module MessageSender

    def publish destination_name, message, headers={}, timeout=10
      System.gateway.publish(destination_name, message, self.class, headers, timeout)
    end

    def receive destination_name, headers={}, timeout=10
      System.gateway.receive(destination_name, self.class, headers, timeout)
    end

  end

end