Skip to content

Retrieve task index? #42

@FezVrasta

Description

@FezVrasta

I'm running the following code where my functions need to pick a web worker from a list in order to run.

const workersList = [worker1, worker2];
await PromisePoool
	.withConcurrency(workerList.length)
	.for(items)
	.process(async (item) => {
		const worker = workerList[executorIndex];

        await runMyLogic(item, worker);
	});

Right now I can't seem to find any way to know which executor is being used from the pool, may you advise?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions