class RJR::Nodes::WebConnection

@private Helper class intialized by eventmachine encapsulating a http connection

Public Class Methods

new(args = {}) click to toggle source

WebConnection initializer.

specify the web node establishing the connection

Calls superclass method
# File lib/rjr/nodes/web.rb, line 46
def initialize(args = {})
  super
  @rjr_node = args[:rjr_node]
end

Public Instance Methods

process_http_request() click to toggle source

{EventMachine::Connection#process_http_request} callback, handle request messages

# File lib/rjr/nodes/web.rb, line 52
def process_http_request
  # TODO support http protocols other than POST
  msg = @http_post_content.nil? ? '' : @http_post_content
  inter = @rjr_node.send(:handle_message, msg, self) # XXX private method

  # XXX we still have to send a response back to client to satisfy
  # the http standard, even if this is a notification. handle_message
  # does not do this.
  notification = Messages::Notification.is_notification_message?(inter)
  @rjr_node.send_msg "", self if notification
end