promise-pauser
Promise-pauser is a Node library for pausing multiple promise chains and/or streams with one call. Allows pausing already started promise chains / streams at controllable points, making it easy to halt multiple concurrent processes when a certain network resource goes down.
The end result is similar to RxJS's Pauser
.
Examples
Also in the /examples directory.
With multiple promise chains
var pause = ;var Promise = ; var pauser = pause;pauser; var chain1 = Promise ; var chain2 = Promise ; console; ;
Streams
You can also use promise-pauser to pause multiple Highland streams with one call.
var Promise = ;var $ = ;var pause = ; var pauser = pause; var str1 = // pause _before_ the map ; /* $.compose($, pause.waitFor(pauser)) == function(x) { return $(pause.waitFor(pauser)(x)) }*/ var str2 = // note that the pause is // _after_ the map ; ;;