private async Task ProcessRequests(IAsyncEnumerable <ClientRequest> clientRequests, CancellationToken cancellationToken)
        {
            await foreach (var request in clientRequests.WithCancellation(cancellationToken))
            {
                _logger.LogInformation($"Received request {request}");

                await _clientQueuedRequests.WriteAsync(request, cancellationToken).ConfigureAwait(false);
            }
        }
        public async Task <TResponse> SendAsync <TResponse>(ClientRequest request, CancellationToken cancellationToken)
            where TResponse : ClientResponse
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            request = request with {
                MetaData = _clientRequestMetaDataFactory.CreateNew()
            };

            _logger.LogInformation($"Adding request {request.MetaData} to queue");

            var pendingClientRequest = await _clientQueuedRequests.WriteAsync(request, cancellationToken).ConfigureAwait(false);

            return((TResponse)await pendingClientRequest.Response.Task.ConfigureAwait(false));
        }
    }