Module: Kameleoon::Events::HttpRequestHandler

Includes:
EventHandler
Defined in:
lib/kameleoon/events/http_request_handler.rb

Overview

Handler of EventType::HTTP_REQUEST SDK events. The handler is called once per each actual HTTP request attempt, including retries.

A handler must respond to the following methods:

# Called when an SDK HTTP request completes successfully.
#
# @param request_type [Symbol] The type of the request, one of the `RequestType` constants.
# @param http_status [Integer] The HTTP status code of the response.
# @param duration_millis [Integer] The duration of the request in milliseconds.
def on_request_succeeded(request_type, http_status, duration_millis); end

# Called when an SDK HTTP request fails.
#
# @param request_type [Symbol] The type of the request, one of the `RequestType` constants.
# @param failure [Kameleoon::Events::HttpRequestFailure] The failure details.
# @param duration_millis [Integer] The duration of the request in milliseconds.
def on_request_failed(request_type, failure, duration_millis); end

Including this module is optional and serves documentation purposes only.