void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e) { if (e.Initiator == ShutdownInitiator.Application && e.ReplyCode == 200) { connectionShutdownCompleted?.TrySetResult(true); } else if (circuitBreaker.Disarmed) { //log entry handled by event handler registered in ConnectionFactory circuitBreaker.Failure(new Exception(e.ToString())); _ = Task.Run(() => Reconnect()); } else { Logger.WarnFormat("'{0}' connection shutdown while reconnect already in progress: {1}", name, e); } }
void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e) { if (e.Initiator == ShutdownInitiator.Application && e.ReplyCode == 200) { connectionShutdownCompleted?.TrySetResult(true); } else { circuitBreaker.Failure(new Exception(e.ToString())); } }