X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fworker-node.ts;h=4799e11c03d1677e86ad675c31ffe7b64982c807;hb=26fb3c18b678a1daab6b18a351a238fb5a3ed5df;hp=079881b94cf165a16f4fe2e6be9c4223579a8346;hpb=da9fb5942126ecd4a897d62b0bda23274a7a3959;p=poolifier.git diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 079881b9..4799e11c 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -30,18 +30,18 @@ implements IWorkerNode { /** @inheritdoc */ public readonly info: WorkerInfo /** @inheritdoc */ - public messageChannel?: MessageChannel - /** @inheritdoc */ public usage: WorkerUsage /** @inheritdoc */ + public messageChannel?: MessageChannel + /** @inheritdoc */ public tasksQueueBackPressureSize: number /** @inheritdoc */ public onBackPressure?: (workerId: number) => void /** @inheritdoc */ public onEmptyQueue?: (workerId: number) => void - private readonly taskFunctionsUsage: Map private readonly tasksQueue: Deque> private onEmptyQueueCount: number + private readonly taskFunctionsUsage: Map /** * Constructs a new worker node. @@ -75,14 +75,14 @@ implements IWorkerNode { } this.worker = worker this.info = this.initWorkerInfo(worker, workerType) + this.usage = this.initWorkerUsage() if (workerType === WorkerTypes.thread) { this.messageChannel = new MessageChannel() } - this.usage = this.initWorkerUsage() - this.taskFunctionsUsage = new Map() - this.tasksQueue = new Deque>() this.tasksQueueBackPressureSize = tasksQueueBackPressureSize + this.tasksQueue = new Deque>() this.onEmptyQueueCount = 0 + this.taskFunctionsUsage = new Map() } /** @inheritdoc */