You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scenario where I'm iterating through a cursor but while I'm iterating I'm already processing the results.
So, there is a considerable delay between the scanning and the final, here's a pseudo-example:
x=Queue.newbar=ProgressBar.new(Float::INFINITY)Thread.newdoi=0cursor.eachdo |foo|
x << fooendbar.total=ix.closeendThread.newdowhile(item=x.pop)process(item)bar.increment!endend
Would be nice to have the progress bar in a state that says how many were processed but not the total/ETA yet while that.
Otherwise, I have to implement some dark magic to wait until the scan is done:
x=Queue.newmutex=Mutex.newprocessed=0total=0bar=nilThread.newdocursor.eachdo |foo|
x << foototal += 1endmutex.synchronizedobar=ProgressBar.new(total)bar.increment!(processed)endend10.timesdoThread.newdowhile(item=x.pop)process(item)mutex.synchronizedoprocessed += 1bar&.increment!endendend
The text was updated successfully, but these errors were encountered:
I'd be willing to take a look at a PR that treated a max of nil as special, and not do the percent or ETA calculations that depend on knowing the max...
Hi,
I have a scenario where I'm iterating through a cursor but while I'm iterating I'm already processing the results.
So, there is a considerable delay between the scanning and the final, here's a pseudo-example:
Would be nice to have the progress bar in a state that says how many were processed but not the total/ETA yet while that.
Otherwise, I have to implement some dark magic to wait until the scan is done:
The text was updated successfully, but these errors were encountered: