streadway / amqp

Go client for AMQP 0.9.1
http://godoc.org/github.com/streadway/amqp
BSD 2-Clause "Simplified" License
4.88k stars 621 forks source link

Ask a question #407

Closed 124642027 closed 5 years ago

124642027 commented 5 years ago

When creating a connection, a reader gorouine and heartbeater goroutine are started. When sending a message using sends func, the reader can get the message, and the heartbeater gets the data from the deadlines. However, there is a segment code in the send method as follows: select { case c.sends <- time.Now(): default: } I don't understand under what circumstances c.sends <- time.Now() is executed, when c.sends is a non-blocking channel of type chan time.Time. Hope to receive your reply