From ff2fd63bf7db6373e5fb0c1d311c6a139b99dfe0 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 8 Dec 2017 11:17:07 -0600 Subject: [PATCH] rename trySend to send --- common/repeat_timer.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/repeat_timer.go b/common/repeat_timer.go index 77f73603..23faf74a 100644 --- a/common/repeat_timer.go +++ b/common/repeat_timer.go @@ -68,20 +68,20 @@ func (t *RepeatTimer) run() { // don't close channels, as closed channels mess up select reads done = t.processInput(cmd) case tick := <-t.ticker.C: - t.trySend(tick) + t.send(tick) } } } -// trySend performs non-blocking send on t.Ch -func (t *RepeatTimer) trySend(tick time.Time) { - // NOTE: this was blocking in previous version (t.Ch <- t_) - // probably better not: https://golang.org/src/time/sleep.go#L132 - t.output <- tick +// send performs blocking send on t.Ch +func (t *RepeatTimer) send(tick time.Time) { + // XXX: possibly it is better to not block: + // https://golang.org/src/time/sleep.go#L132 // select { // case t.output <- tick: // default: // } + t.output <- tick } // all modifications of the internal state of ThrottleTimer