diff --git a/src/util/ConcurrentQueue.ts b/src/util/ConcurrentQueue.ts index 784e586..e4d33bd 100644 --- a/src/util/ConcurrentQueue.ts +++ b/src/util/ConcurrentQueue.ts @@ -27,7 +27,7 @@ export abstract class ConcurrentQueue { } private async processQueue() { - while (true) { + while (this.items.length > 0) { const item = this.items.pop(); if (item === undefined) { break; diff --git a/src/util/WorkerEventBus.ts b/src/util/WorkerEventBus.ts index cab16b5..9101ce3 100644 --- a/src/util/WorkerEventBus.ts +++ b/src/util/WorkerEventBus.ts @@ -1,6 +1,8 @@ import { nanoid } from 'nanoid'; -export class WorkerClientBus { +/* eslint-disable @typescript-eslint/no-explicit-any */ + +export class WorkerClientBus { private idPromiseMap = new Map void, (error: Error) => void]>(); constructor(private worker: Worker) { @@ -22,7 +24,7 @@ export class WorkerClientBus { }); } - async request(actionName: string, payload: P): Promise { + async request(actionName: T, payload: P): Promise { return new Promise((resolve, reject) => { const id = nanoid(); this.idPromiseMap.set(id, [resolve, reject]);