Esempio n. 1
0
        public async Task <TResponse> PostRequestAsync <TResponse>(IRequest <TResponse> request, CancellationToken cancellationToken)
        {
            var taskCompletionSource = new TaskCompletionSource <object>();
            var req = Request.Wrap(request, taskCompletionSource);
            await _outgoingRequestQueueWriter.EnqueueAsync(req, cancellationToken);

            return((TResponse)await taskCompletionSource.Task);
        }
Esempio n. 2
0
 public async Task DispatchAsync(Request request, CancellationToken cancellationToken)
 {
     await _outgoingRequestQueueWriter.EnqueueAsync(request, cancellationToken);
 }