From 190eca8a19999485db2e5445f4823ddf62f3e360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Rebours?= Date: Fri, 22 Oct 2021 16:02:17 +0200 Subject: [PATCH] minor --- lib/executor.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/executor.js b/lib/executor.js index 6233c13..19a7038 100755 --- a/lib/executor.js +++ b/lib/executor.js @@ -31,10 +31,10 @@ class Waterfall { class Executor { constructor () { this.ready = false - this._mainWaterfallObject = new Waterfall() - this._bufferWaterfallObject = new Waterfall() - this._bufferWaterfallObject.chain(new Promise(resolve => { - this._resolveBuffer = resolve + this.queue = new Waterfall() + this.buffer = new Waterfall() + this.buffer.chain(new Promise(resolve => { + this.triggerBuffer = resolve })) } @@ -77,8 +77,8 @@ class Executor { } pushAsync (task, forceQueuing) { - if (this.ready || forceQueuing) return this._mainWaterfallObject.waterfall(task)() - else return this._bufferWaterfallObject.waterfall(task)() + if (this.ready || forceQueuing) return this.queue.waterfall(task)() + else return this.buffer.waterfall(task)() } /** @@ -87,8 +87,8 @@ class Executor { */ processBuffer () { this.ready = true - this._resolveBuffer() - this._mainWaterfallObject.waterfall(() => this._bufferWaterfallObject.guardian) + this.triggerBuffer() + this.queue.waterfall(() => this.buffer.guardian) } }