def notify(event, routing_keys)
      event[:uuid] ||= RightSupport::Data::UUID.generate
      event[:version] ||= AgentConfig.protocol_version
      params = {:event => event}
      params[:routing_keys] = routing_keys if routing_keys
      if @websocket
        path = event[:path] ? " #{event[:path]}" : ""
        to = routing_keys ? " to #{routing_keys.inspect}" : ""
        Log.info("Sending EVENT <#{event[:uuid]}> #{event[:type]}#{path}#{to}")
        @websocket.send(JSON.dump(params))
      else
        make_request(:post, "/notify", params, "notify", :request_uuid => event[:uuid], :filter_params => ["event"])
      end
      true
    end
def notify(event, routing_keys)
      event[:uuid] ||= RightSupport::Data::UUID.generate
      event[:version] ||= AgentConfig.protocol_version
      params = {:event => event}
      params[:routing_keys] = routing_keys if routing_keys
      if @websocket
        path = event[:path] ? " #{event[:path]}" : ""
        to = routing_keys ? " to #{routing_keys.inspect}" : ""
        Log.info("Sending EVENT <#{event[:uuid]}> #{event[:type]}#{path}#{to}")
        @websocket.send(JSON.dump(params))
      else
        make_request(:post, "/notify", params, "notify", :request_uuid => event[:uuid], :filter_params => ["event"])
      end
      true
    end
def notify ( event , routing_keys ) event [ :uuid ] ||= RightSupport :: Data :: UUID . generate event [ :version ] ||= AgentConfig . protocol_version params = { :event => event } params [ :routing_keys ] = routing_keys if routing_keys if @websocket path = event [ :path ] ? " #{event[:path]}" : "" to = routing_keys ? " to #{routing_keys.inspect}" : "" Log . info ( "Sending EVENT <#{event[:uuid]}> #{event[:type]}#{path}#{to}" ) @websocket . send ( JSON . dump ( params ) ) else make_request ( :post , "/notify" , params , "notify" , :request_uuid => event [ :uuid ] , :filter_params => [ "event" ] ) end true end
Route event
 Use WebSocket if possible
 Do not block this request even if in the process of closing since used for request responses

 @param [Hash] event to send
 @param [Array, NilClass] routing_keys as strings to assist router in delivering
   event to interested parties

 @return [TrueClass] always true

 @raise [Exceptions::Unauthorized] authorization failed
 @raise [Exceptions::ConnectivityFailure] cannot connect to server, lost connection
   to it, or it is out of service or too busy to respond
 @raise [Exceptions::RetryableError] request failed but if retried may succeed
 @raise [Exceptions::Terminating] closing client and terminating service
 @raise [Exceptions::InternalServerError] internal error in server being accessed
Route event Use WebSocket if possible Do not block this request even if in the process of closing since used for request responses