agent/local: clarify the non-risk of a full buffer

This commit is contained in:
Mitchell Hashimoto 2018-05-02 14:31:03 -07:00
parent 31b09c0674
commit 657c09133a
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 5 additions and 1 deletions

View File

@ -722,7 +722,11 @@ func (l *State) Proxies() map[string]*ManagedProxy {
// NotifyProxy will register a channel to receive messages when the
// configuration or set of proxies changes. This will not block on
// channel send so ensure the channel has a large enough buffer.
// channel send so ensure the channel has a buffer. Note that any buffer
// size is generally fine since actual data is not sent over the channel,
// so a dropped send due to a full buffer does not result in any loss of
// data. The fact that a buffer already contains a notification means that
// the receiver will still be notified that changes occurred.
//
// NOTE(mitchellh): This could be more generalized but for my use case I
// only needed proxy events. In the future if it were to be generalized I