+ const task = this.tasksQueue.shift()
+ if (
+ this.onEmptyQueue != null &&
+ this.tasksQueue.size === 0 &&
+ this.onEmptyQueueCount === 0
+ ) {
+ this.startOnEmptyQueue().catch(EMPTY_FUNCTION)
+ }
+ return task
+ }
+
+ /** @inheritdoc */
+ public popTask (): Task<Data> | undefined {
+ const task = this.tasksQueue.pop()
+ if (
+ this.onEmptyQueue != null &&
+ this.tasksQueue.size === 0 &&
+ this.onEmptyQueueCount === 0
+ ) {
+ this.startOnEmptyQueue().catch(EMPTY_FUNCTION)
+ }
+ return task