private async Task <Response> TransferMessageIntoQueue(Request req, CancellationToken cancellationtoken) { AsyncTransferQueue <JObject> queue; if (!_asyncQueues.TryGetValue(req, out queue)) { return(_helper.NotFoundForPath()); } if (!req.Headers.TryGetValue("timeout", out string timeout)) { timeout = "0"; } bool result = await queue.TransferAsync(req.Payload, int.Parse(timeout), cancellationtoken); return(result ? _helper.OperationSuccessful("Request successfully transfered!") : _helper.TimeoutResponse()); }
public void NotifyShutdownCompleted() { request?.SetResult(_httpHelper.OperationSuccessful()); }