Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Continuation policy

jmarnold edited this page · 6 revisions

Overview

Continuation policies are objects that are invoked during the Continuation Pipeline. They conform to a simple data structure that requires two methods:

  1. matches(continuation) : bool
  2. execute(continuation) : void

matches

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; }

execute

This function is used to perform anything and everything using the continuation.

Example:

execute: function(continuation) { console.log(continuation.message); }

More examples and defaults

Default policies are included out of the box and serve as a baseline to show what can be done. Check them out here.

Something went wrong with that request. Please try again.