export default class AsyncQueue {
    constructor() {
        this.s3 = [];
        this.t3 = false;
    }
    z1(task) {
        this.s3.push(task);
        this.u3();
    }
    async u3() {
        if (this.t3) {
            return;
        }
        if (this.s3.length === 0) {
            return;
        }
        this.t3 = true;
        const task = this.s3.shift();
        try {
            await task();
        }
        finally {
            this.t3 = false;
            this.u3();
        }
    }
}
