Skip to content
Snippets Groups Projects
Verified Commit 31dcc718 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

refactor: introduce variable for better debugging

parent a26eb960
No related branches found
No related tags found
No related merge requests found
......@@ -86,9 +86,8 @@ class Processing extends Base {
*
* So the execution time is timeout1+timeout1+timeout1+timeout2
*
* @param {int} timeout Timeout
* @param {function} callback Callback
* @throw {TypeError} the arguments must be either integer or functions
* @param {...(int|function)} args
*/
constructor(...args) {
super();
......@@ -136,13 +135,17 @@ class Processing extends Base {
*/
run(data) {
const self = this;
if (this[internalSymbol].queue.isEmpty()) {
if (self[internalSymbol].queue.isEmpty()) {
return Promise.resolve(data);
}
return this[internalSymbol].queue
.poll()
.run(data)
const callback = self[internalSymbol].queue.poll();
if (callback === null || callback === undefined) {
return Promise.resolve(data);
}
return callback.run(data)
.then((result) => {
return self.run(result);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment