-
Notifications
You must be signed in to change notification settings - Fork 4
Continuation Events
Several events are useful to listen for during the processing of requests. The events are referred to as "topics" (ala amplifyjs):
Occurs whenever a new request is started. It has a correlationId
property containing the ID of the request.
Occurs whenever a request has completed. It has a correlationId
property containing the ID of the request which can be used to correlate with the AjaxStarted event.
In order for the correlation process to work, your web framework must be made aware of the X-Correlation-Id
header. This header is sent in the request and is expected to be in the response (in order to properly correlate).
Occurs whenever a continuation is processed and the error
property has a length greater than 0.
Occurs whenever a continuation is processed and the status code is not 200.
You can listen for any of the events using the bind
method on the root continuations object:
$.continuations.bind('AjaxStarted', function(payload) { console.log(payload.correlationId); });
Note: You can also bind to '*' as a wildcard to listen for all events.
There is an adapter available to relay all Continuation events through amplify. Simply include jquery.continuations.amplify.js