Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When agent write goroutine closed the channel heartbeat and send functions could still write to the channel causing a panic. send already had a recover for this but heartbeat didn't have. This commit does not close the channel anymore and to make so the writers don't block sending when an agent is closed a select is used reading from die channel that signals that a agent is closed. The write channel is never closed but it's ok as when a Agent is not used anymore it will be garbage collected as the agent is the only reference to it.
- Loading branch information