Пример #1
0
        private async Task <Response> TransferAsync(ITransferQueue <JObject> selectedQ, Request request, CancellationToken cToken)
        {
            if (selectedQ == null)
            {
                return(FormatResponse(request.Payload, status: (int)HttpStatusCode.BadRequest));
            }

            bool success = await selectedQ.TransferAsync(request.Payload, timeout : Convert.ToInt32(request.Headers["timeout"]), cToken : cToken);

            return(FormatResponse(request.Payload, success ? (int)HttpStatusCode.OK : (int)HttpStatusCode.RequestTimeout));
        }
Пример #2
0
 public void Log(string report)
 {
     queue.TransferAsync(report, MAX_WAIT_TIME, cToken);
 }