parallel icon indicating copy to clipboard operation
parallel copied to clipboard

Awaiting on worker pool to be empty.

Open whataboutpereira opened this issue 3 years ago • 0 comments

Using amp/parallel v2.

Is there a more sensible way to wait/await for the worker pool to become empty? Maybe a helper function hidden somewhere?

Currently using:

while(($pool->getWorkerCount() - $pool->getIdleWorkerCount()) > 0) {
	delay(0.1);
}

A helper function in the default pool along the lines of getActiveWorkerCount() $pool->getWorkerCount() - $pool->getIdleWorkerCount() would also be a nice addition. :)

whataboutpereira avatar Oct 02 '22 18:10 whataboutpereira