Open jhendrixMSFT opened 2 years ago
Should follow the same pattern as context.Done
.
func (c *Conn) Done() <-chan error {...}
I did some tests, and the Sender
close is not called when I close/drop the connection linked to the Connection.
For example:
conn, err := amqp.Dial( .....)
session, err := conn.NewSession(......)
sender, err := session.NewSender(...))
conn.Close() //<------ Connection closed
https://github.com/Azure/go-amqp/blob/f631e69097193293dd1b0a2177469eafe89e4a06/link.go#L291-L301
So I wondered how to intercept the Sender
Receiver
close when it is not called directly.
Thank you
Adding Done() <-chan error
has a wrinkle. Once the error, assuming there's one, is read from the channel, subsequent reads from the channel will always return nil
. Unclear if this is problematic in practice but needs to be thought through.
This would allow responding to the event that the link has been detached.