Closed dktapps closed 1 year ago
This was introduced due to refactors in 5.0.0.
Neither the GC queue nor the pending tasks queue contains the currently running task when collect() is called, causing it to return 0. In a loop like this:
collect()
0
while($worker->collect(function(ThreadedRunnable $work) : void{ //do something... }) > 0);
the loop may exit early while there is a task still to be collected, since it doesn't account for the currnetly-running task.
This was introduced due to refactors in 5.0.0.
Neither the GC queue nor the pending tasks queue contains the currently running task when
collect()
is called, causing it to return0
. In a loop like this:the loop may exit early while there is a task still to be collected, since it doesn't account for the currnetly-running task.