import type { DecryptCommandPayload } from '~/decrypt-worker/types'; import { DECRYPTION_WORKER_ACTION_NAME, DecryptionResult } from '~/decrypt-worker/constants'; import { ConcurrentQueue } from './ConcurrentQueue'; import { WorkerClientBus } from './WorkerEventBus'; export class DecryptionQueue extends ConcurrentQueue { constructor(private workerClientBus: WorkerClientBus, maxQueue?: number) { super(maxQueue); } async handler(item: DecryptCommandPayload): Promise { return this.workerClientBus.request(DECRYPTION_WORKER_ACTION_NAME.DECRYPT, item); } }