|
|
@@ -52,6 +52,9 @@ proto.coalesce = function coalesce(nextSource) {
|
|
|
proto.getNext = function getNext(callback) {
|
|
|
if (!callback) throw new Error(this.getSourceName() + ' #getNext() requires callback');
|
|
|
|
|
|
+ if (this.expCtx instanceof Object && this.expCtx.checkForInterrupt && this.expCtx.checkForInterrupt() === false)
|
|
|
+ return callback(new Error("Interrupted"));
|
|
|
+
|
|
|
if (++this.count > this.limit) {
|
|
|
this.source.dispose();
|
|
|
callback(null, DocumentSource.EOF);
|