vbauerster / mpb

multi progress bar for Go cli applications
The Unlicense
2.29k stars 123 forks source link

Callback before refreshing bars #67

Closed nilsocket closed 4 years ago

nilsocket commented 4 years ago

Is there any possibility of having a call-back function being called before refreshing bars, If so how?

i.e.,

bar.BeforeRefresh(func(){})

If this is not possible, can you provide it?

Why do I need it? I use aria2c for downloading, I'm trying to get status of from aria2c, only before refreshing, so I can save some CPU time.

Thank you.

nilsocket commented 4 years ago

I see that, I can manage by doing my work before sending time to a channel of mpb.WithManualRefresh().

Don't you think, it would be better to have argument of type chan struct{}, rather than chan time.Time, as it would be more obvious.

Thank you.