Class: AjaxMonitor

AjaxMonitor

Monitors all ajax requests made in the application. If enough requests fail in a certain time frame, AjaxMonitor determines the connection to be lost. It then begins a heartbeat and blocks all other requests until at least on heartbeat requests is responded to

Constructor

new AjaxMonitor(options)

Constructor
Parameters:
Name Type Description
options object
Properties
Name Type Attributes Default Description
heartbeatUrl string URL to send a heartbeat req to
maxFailures number <optional>
4 the max amount of ajax failures that can occur in the ajaxTimeout setting, before the monitor determines the connection ist lost
resetTimer number <optional>
10000 the time in which the max amount of failures can occur before the monitor determines the connection is lost
ajaxTimeout number <optional>
0 the global timeout for all ajax reqs
abortOnDisconnecttrue boolean <optional>
whether to abort all requests before they can be made if AjaxMonitor is "disconnected"
Source:

Methods

checkLimit() → {AjaxMonitor}

Check if enough failures have occurred in the given time frame
Source:
Returns:
Type
AjaxMonitor

reset() → {AjaxMonitor}

Reset the recorded failure count
Source:
Returns:
Type
AjaxMonitor

start() → {AjaxMonitor}

Start the monitor
Source:
Returns:
Type
AjaxMonitor

stop() → {AjaxMonitor}

Stop the monitor
Source:
Returns:
Type
AjaxMonitor