-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
The SendLoop func on many of the metric reporters takes in a <-chan time.Time and blocks until that channel is closed.
As the docs say, this is most typically used by creating a time.Ticker and passing its C channel.
This works great except for the fact that the C channel in the ticker can never be closed. You can call Stop on the ticker but this doesn't close the channel (golang/go#2650).
This effectively means that there's no straightforward way to return from the SendLoop func when used together with a time.Ticker.
I guess it would be nice if the func could take a ctx as first parameter and return when ctx.Done() is closed.
Reactions are currently unavailable