@ -53,10 +53,9 @@ func getNewChannel(url string, conf amqp.Config) (*amqp.Connection, *amqp.Channe
// backoff. Once reconnected, it sends an error back on the manager's notifyCancelOrClose
// backoff. Once reconnected, it sends an error back on the manager's notifyCancelOrClose
// channel
// channel
func ( chManager * channelManager ) startNotifyCancelOrClosed ( ) {
func ( chManager * channelManager ) startNotifyCancelOrClosed ( ) {
notifyCloseChan := make ( chan * amqp . Error )
notifyCloseChan = chManager . channel . NotifyClose ( notifyCloseChan )
notifyCancelChan := make ( chan string )
notifyCancelChan = chManager . channel . NotifyCancel ( notifyCancelChan )
notifyCloseChan := chManager . channel . NotifyClose ( make ( chan * amqp . Error , 1 ) )
notifyCancelChan := chManager . channel . NotifyCancel ( make ( chan string , 1 ) )
select {
select {
case err := <- notifyCloseChan :
case err := <- notifyCloseChan :
// If the connection close is triggered by the Server, a reconnection takes place
// If the connection close is triggered by the Server, a reconnection takes place
@ -72,18 +71,6 @@ func (chManager *channelManager) startNotifyCancelOrClosed() {
chManager . logger . Printf ( "successfully reconnected to amqp server after cancel" )
chManager . logger . Printf ( "successfully reconnected to amqp server after cancel" )
chManager . notifyCancelOrClose <- errors . New ( err )
chManager . notifyCancelOrClose <- errors . New ( err )
}
}
// these channels can be closed by amqp
select {
case <- notifyCloseChan :
default :
close ( notifyCloseChan )
}
select {
case <- notifyCancelChan :
default :
close ( notifyCancelChan )
}
}
}
// reconnectWithBackoff continuously attempts to reconnect with an
// reconnectWithBackoff continuously attempts to reconnect with an