Skip to content

Commit b9eadaa

Browse files
committed
refactor: use object destructuration in worker message listener
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
1 parent b7bf23f commit b9eadaa

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/pools/abstract-pool.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,19 +1666,20 @@ export abstract class AbstractPool<
16661666
message: MessageValue<Response>,
16671667
) {
16681668
this.checkMessageWorkerId(message)
1669+
const { workerId, ready, taskId, taskFunctionNames } = message
16691670
if (
1670-
message.ready != null && message.taskFunctionNames != null
1671+
ready != null && taskFunctionNames != null
16711672
) {
16721673
// Worker ready response received from worker
16731674
this.handleWorkerReadyResponse(message)
1674-
} else if (message.taskId != null) {
1675+
} else if (taskId != null) {
16751676
// Task execution response received from worker
16761677
this.handleTaskExecutionResponse(message)
1677-
} else if (message.taskFunctionNames != null) {
1678+
} else if (taskFunctionNames != null) {
16781679
// Task function names message received from worker
16791680
this.getWorkerInfo(
1680-
this.getWorkerNodeKeyByWorkerId(message.workerId),
1681-
).taskFunctionNames = message.taskFunctionNames
1681+
this.getWorkerNodeKeyByWorkerId(workerId),
1682+
).taskFunctionNames = taskFunctionNames
16821683
}
16831684
}
16841685

0 commit comments

Comments
 (0)