Commit 05b63147 authored by Nicolai Kamenzky's avatar Nicolai Kamenzky
Browse files

Merge pull request #75 from hildjj/cls-depend

Remove explicit CLS dependency
parents ea0fd0c1 bf90827d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -427,7 +427,7 @@ function reverseBody(body, response, resolveWithFullResponse) {


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