I have nothing to comment about timer.Reset() but your pseudo code made me
wonder if there's an interval timer available in the library, and of course
it is.
In the example you aim to do some work periodically, until another type of
work succeeds. That's not a plain meaning of a timeout. In
Thank you very much for confirming that, Ian!
FWIW the scenario is very roughly along the lines of a "best effort
re-configurable" timeout for a work loop:
timeout := <-timeoutConfigC
timer := time.NewTimer(timeout)
defer timer.Stop()
for {
select {
case timeout = <-timeoutConfigC:
On Wed, Apr 1, 2020 at 11:05 AM Neil Schellenberger
wrote:
>
> I am almost certainly overthinking this or in some other way "doing it
> wrong"--so please (dis)abuse me.
>
> The Timer.Reset() documentation reads (in part) "Reset should be invoked only
> on stopped or expired timers with drained
Hi Folks,
I am almost certainly overthinking this or in some other way "doing it
wrong"--so please (dis)abuse me.
The Timer.Reset() documentation reads (in part) "Reset should be invoked
only on stopped or expired timers with drained channels."
Am I correct in understanding that "should" in