|
|
|
@ -3,6 +3,7 @@
|
|
|
|
|
const Promise = require("bluebird");
|
|
|
|
|
const ms = require("ms");
|
|
|
|
|
const promiseDelaySince = require("@joepie91/promise-delay-every");
|
|
|
|
|
const propagateAbort = require("@ppstreams/propagate-abort");
|
|
|
|
|
|
|
|
|
|
module.exports = function rateLimitedStream(interval) {
|
|
|
|
|
let intervalInMilliseconds = (typeof interval === "number")
|
|
|
|
@ -20,8 +21,6 @@ module.exports = function rateLimitedStream(interval) {
|
|
|
|
|
return source.read();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
abort: (source, reason) => {
|
|
|
|
|
source.abort(reason);
|
|
|
|
|
}
|
|
|
|
|
abort: propagateAbort
|
|
|
|
|
}
|
|
|
|
|
};
|