/**
 * A simple sequential operation queue.
 * Operations are executed in FIFO order - each waits for the previous to complete.
 */
export class OperationQueue {
    chain = Promise.resolve();
    enqueue(fn) {
        const result = this.chain.then(fn);
        this.chain = result.then(() => { }, () => { });
        return result;
    }
}
//# sourceMappingURL=operation-queue.js.map