public Task <IOnPremiseConnectorResponse> GetResponseAsync(string requestId, TimeSpan?requestTimeout = null) { CheckDisposed(); var timeout = requestTimeout ?? _configuration.OnPremiseConnectorCallbackTimeout; _logger?.Debug("Waiting for response. request-id={RequestId}, timeout={Timeout}", requestId, timeout); var onPremiseConnectorCallback = _requestCompletedCallbacks[requestId] = _requestCallbackFactory.Create(requestId); return(GetOnPremiseTargetResponseAsync(onPremiseConnectorCallback, timeout, _cancellationToken)); }
public override Task <IOnPremiseTargetReponse> GetResponseAsync(string requestId) { CheckDisposed(); _logger.Debug("Waiting for response for request '{0}'", requestId); var onPremiseConnectorCallback = _onPremiseConnectorCallbackFactory.Create(requestId); _callbacks[requestId] = onPremiseConnectorCallback; var task = Task <IOnPremiseTargetReponse> .Factory.StartNew(WaitForOnPremiseTargetResponse, onPremiseConnectorCallback); return(task); }