export class Vault {
#eventTarget: EventTarget = new EventTarget()
#job?: Task
- #isIdle: boolean = true
#isLocked: boolean = true
#isTerminated: boolean = false
#queue: Task[] = []
reject
}
this.#queue.push(task)
- if (this.#isIdle) this.#process()
+ if (this.#job == null) this.#process()
})
}
#process = (): void => {
this.#job = this.#queue.shift()
- this.#isIdle = this.#job == null
if (this.#job != null) {
const { url, id, data, reject } = this.#job
const buffers: ArrayBuffer[] = []