-
Notifications
You must be signed in to change notification settings - Fork 4
Continuation policy
jmarnold edited this page Jul 7, 2012
·
6 revisions
Continuation policies are objects that are invoked during the Continuation Pipeline. They conform to a simple data structure that requires two methods:
- matches(continuation) : bool
- execute(continuation) : void
This function is used to evaluate whether the policy applies to the continuation by returning true or false.
Example:
matches: function(continuation) { return continuation.statusCode == 200; }
This function is used to perform anything and everything using the continuation.
Example:
execute: function(continuation) { console.log(continuation.message); }
Default policies are included out of the box and serve as a baseline to show what can be done. Check them out here.