protected virtual void SetupConnectionRecovery(IConnection connection = null)
{
connection = connection ?? _connection;
var recoverable = connection as IRecoverable;
if (recoverable == null)
{
_logger.LogInformation("Connection is not Recoverable. Failed connection will cause unhandled exception to be thrown.");
return;
}
_logger.LogDebug("Setting up Connection Recovery");
recoverable.Recovery += (sender, args) =>
{
_logger.LogInformation($"Connection has been recovered. Starting channel processing.");
EnsureRequestsAreHandled();
};
}