36 this ITopicClient topicClient,
42 CancellationToken cancellationToken)
44 const int PrioritySendAttempts = 5;
45 var endpoint =
new IPEndPoint(IPAddress.Loopback, port);
48 for (var i = PrioritySendAttempts - 1; i >= 0 && (priority || firstSend); --i)
54 logger.LogTrace(
"Begin topic request #{requestId}: {query}", localRequestId, queryString);
55 var byondResponse = await topicClient.SendTopic(
60 logger.LogTrace(
"End topic request #{requestId}", localRequestId);
63 catch (
Exception ex) when (ex is not OperationCanceledException && ex is not ArgumentException)
65 logger.LogWarning(ex,
"SendTopic exception!{retryDetails}", priority ? $
" {i} attempts remaining." : String.Empty);
67 if (priority && i > 0)
68 await delayer.
Delay(TimeSpan.FromSeconds(2), cancellationToken);