/// <summary> /// ProcessRequests processes all registered requests. If the page is asynchronous then the requests will be submitted asynchronously. Otherwise the responses will be returned synchronously. /// </summary> /// <param name="page">The page instance on which this instance is defined.</param> public void ProcessRequests(Page page) { if (NothingToProcess) { isProcessed = true; if (AllIsCached) { OnResponseReady(); } return; } isProcessed = true; if (page != null && page.IsAsync) { Log.LogEntry.Categories(CategoryFlags.Debug).Message("Processing async request. Thread: [{0}]", Thread.CurrentThread.ManagedThreadId).WriteVerbose(); page.RegisterAsyncTask(new PageAsyncTask(AsyncTask)); } else { Log.LogEntry.Categories(CategoryFlags.Debug).Message("Processing sync request. Thread: [{0}]", Thread.CurrentThread.ManagedThreadId).WriteVerbose(); try { var responses = ExposeProxy.Process(RequestList); PopulateResponses(responses); } catch (Exception ex) { exception = ex; OnResponseReady(); } } }
private string GetCertificateThumbprint() { if (exposeProxy == null) { // ReSharper disable once UnusedVariable var justARefToCreateProxy = ExposeProxy.GetType(); } return(exposeProxy?.ClientCredentials?.ClientCertificate.Certificate?.Thumbprint); }
private async Task AsyncTask() { try { var data = await ExposeProxy.ProcessAsync(RequestList); PopulateResponses(data); } catch (Exception ex) { exception = ex; OnResponseReady(); } }
/// <summary> /// ProcessRequests processes all registered requests. The responses will be returned synchronously. /// </summary> public async Task ProcessRequestsAsync() { var responses = ExposeProxy.ProcessAsync(RequestList); PopulateResponses(await responses); }