src/courier/PostMessageCourier.js
function _initializeFailFast(options) {
                var messureTime = PostMessageUtilities.parseNumber(options.messureTime, DEFAULT_MESSURE_TIME);
                this.circuit = new CircuitBreaker({
                    timeWindow: messureTime,
                    slidesNumber: Math.ceil(messureTime / 100),
                    tolerance: PostMessageUtilities.parseNumber(options.messureTolerance, DEFAULT_MESSURE_TOLERANCE),
                    calibration: PostMessageUtilities.parseNumber(options.messureCalibration, DEFAULT_MESSURE_CALIBRATION),
                    onopen: PostMessageUtilities.parseFunction(options.ondisconnect, true),
                    onclose: PostMessageUtilities.parseFunction(options.onreconnect, true)
                });
            }
function _initializeFailFast(options) {
                var messureTime = PostMessageUtilities.parseNumber(options.messureTime, DEFAULT_MESSURE_TIME);
                this.circuit = new CircuitBreaker({
                    timeWindow: messureTime,
                    slidesNumber: Math.ceil(messureTime / 100),
                    tolerance: PostMessageUtilities.parseNumber(options.messureTolerance, DEFAULT_MESSURE_TOLERANCE),
                    calibration: PostMessageUtilities.parseNumber(options.messureCalibration, DEFAULT_MESSURE_CALIBRATION),
                    onopen: PostMessageUtilities.parseFunction(options.ondisconnect, true),
                    onclose: PostMessageUtilities.parseFunction(options.onreconnect, true)
                });
            }
function _initializeFailFast ( options ) { var messureTime = PostMessageUtilities . parseNumber ( options . messureTime , DEFAULT_MESSURE_TIME ) ; this . circuit = new CircuitBreaker ( { timeWindow : messureTime , slidesNumber : Math . ceil ( messureTime / 100 ) , tolerance : PostMessageUtilities . parseNumber ( options . messureTolerance , DEFAULT_MESSURE_TOLERANCE ) , calibration : PostMessageUtilities . parseNumber ( options . messureCalibration , DEFAULT_MESSURE_CALIBRATION ) , onopen : PostMessageUtilities . parseFunction ( options . ondisconnect , true ) , onclose : PostMessageUtilities . parseFunction ( options . onreconnect , true ) } ) ; }
Method for initializing the fail fast mechanisms
@param {Number} [options.messureTime = 30000] - optional milliseconds parameter for time measurement indicating the time window to apply when implementing the internal fail fast mechanism (default is 30 seconds)
@param {Number} [options.messureTolerance = 30] - optional percentage parameter indicating the tolerance to apply on the measurements when implementing the internal fail fast mechanism (default is 30 percents)
@param {Number} [options.messureCalibration = 10] optional numeric parameter indicating the calibration of minimum calls before starting to validate measurements when implementing the internal fail fast mechanism (default is 10 calls)
@param {Function} [options.ondisconnect] - optional disconnect handler that will be invoked when the fail fast mechanism disconnects the component upon to many failures
@param {Function} [options.onreconnect] - optional reconnect handler that will be invoked when the fail fast mechanism reconnects the component upon back to normal behaviour
@private
Method for initializing the fail fast mechanisms