Commit bf90827d authored by Joe Hildebrand's avatar Joe Hildebrand
Browse files

As suggested in #70

parent ea0fd0c1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -427,7 +427,7 @@ function reverseBody(body, response, resolveWithFullResponse) {

## Experimental Support for Continuation Local Storage

Continuation Local Storage (CLS) is a great mechanism for backpacking data along asynchronous call chains that is best explained in [these slides](http://fredkschott.com/post/2014/02/conquering-asynchronous-context-with-cls/). If you want to use CLS you need to install the [continuation-local-storage package](https://www.npmjs.com/package/continuation-local-storage). Request-Promise internally uses the [cls-bluebird package](https://www.npmjs.com/package/cls-bluebird) to enable CLS also within the Bluebird promises.
Continuation Local Storage (CLS) is a great mechanism for backpacking data along asynchronous call chains that is best explained in [these slides](http://fredkschott.com/post/2014/02/conquering-asynchronous-context-with-cls/). If you want to use CLS you need to install the [continuation-local-storage package](https://www.npmjs.com/package/continuation-local-storage) and the [cls-bluebird package](https://www.npmjs.com/package/cls-bluebird).

Just call `rp.bindCLS(ns)` **ONCE** before your first request to activate CLS:
``` js
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@
  },
  "dependencies": {
    "bluebird": "^2.3",
    "cls-bluebird": "^1.0.1",
    "lodash": "^3.10.0",
    "request": "^2.34"
  },
@@ -40,6 +39,7 @@
    "chai-as-promised": "5.1.x",
    "chalk": "^1.1.1",
    "cheerio": "^0.19.0",
    "cls-bluebird": "^1.0.1",
    "continuation-local-storage": "^3.1.4",
    "event-stream": "3.3.x",
    "gulp": "3.9.x",