Project Name File Name Usage Source Code Link
CouchDude GetFileTask.cs httpClient .SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead) .ContinueWith( getDistributiveTask => { var response = getDistributiveTask.Result; response.EnsureSuccessStatusCode(); var downloadingFileName = string.Format("{0}.{1}.zip", Guid.NewGuid(), distributiveUri.Segments.LastOrDefault() ?? string.Empty); var tempFile = new FileInfo(Path.Combine(tempDir.FullName, downloadingFileName)); var tempFileWriteStream = tempFile.OpenWrite(); return response.Content .CopyToAsync(tempFileWriteStream) .ContinueWith( copyTask => { copyTask.Wait(); // ensuring exception propagated (is it nessesary?) tempFileWriteStream.Close(); return tempFile; }); }) .Unwrap() Link To Source File
Pentacorn LinqToTasks.cs source.ContinueWith(t => selector(t.Result), TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
Pentacorn LinqToTasks.cs source.ContinueWith(t => { return collectionSelector(t.Result). ContinueWith(c => resultSelector(t.Result, c.Result), TaskContinuationOptions.NotOnCanceled); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
Pentacorn LinqToTasks.cs outer.ContinueWith(delegate { var cts = new CancellationTokenSource(); return inner.ContinueWith(delegate { // Propagate all exceptions Task.WaitAll(outer, inner); // Both completed successfully, so if their keys are equal, return the result if (comparer.Equals(outerKeySelector(outer.Result), innerKeySelector(inner.Result))) { return resultSelector(outer.Result, inner.Result); } // Otherwise, cancel this task. else { cts.CancelAndThrow(); return default(TResult); // won't be reached } }, cts.Token, TaskContinuationOptions.NotOnCanceled, TaskScheduler.Default); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
Pentacorn LinqToTasks.cs outer.ContinueWith(delegate { var cts = new CancellationTokenSource(); return inner.ContinueWith(delegate { // Propagate all exceptions Task.WaitAll(outer, inner); // Both completed successfully, so if their keys are equal, return the result if (comparer.Equals(outerKeySelector(outer.Result), innerKeySelector(inner.Result))) { return resultSelector(outer.Result, inner); } // Otherwise, cancel this task. else { cts.CancelAndThrow(); return default(TResult); // won't be reached } }, cts.Token, TaskContinuationOptions.NotOnCanceled, TaskScheduler.Default); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
tdameritrade WebRequestExtensions.cs webRequest.GetResponseAsync().ContinueWith(response => { return response.Result.GetResponseStream().ReadAllBytesAsync(); }).Unwrap() Link To Source File
tdameritrade WebRequestExtensions.cs webRequest.GetResponseAsync().ContinueWith(response => { return response.Result.GetResponseStream().ReadXmlAsync(); }).Unwrap() Link To Source File
tdameritrade TDAClient.cs Task.Factory.StartNew(() => { var webRequest = CreateWebRequest(url); if (data == null) { return webRequest.DownloadXmlAsync(); } else { return webRequest.PostDataAsync(data).ContinueWith(_ => { return webRequest.DownloadXmlAsync(); }).Unwrap(); } }).Unwrap() Link To Source File
tdameritrade TDAClient.cs webRequest.PostDataAsync(data).ContinueWith(_ => { return webRequest.DownloadXmlAsync(); }).Unwrap() Link To Source File
YUV.KA PipelineDriver.cs previous.ContinueWith(_ => getResult(), token, TaskContinuationOptions.AttachedToParent, TaskScheduler.Current).Unwrap() Link To Source File
SwarmIntelligence WebRequestExtensions.cs webRequest.GetResponseAsync().ContinueWith(response => { return response.Result.GetResponseStream().ReadAllBytesAsync(); }).Unwrap() Link To Source File
SwarmIntelligence LinqToTasks.cs source.ContinueWith(t => selector(t.Result), TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
SwarmIntelligence LinqToTasks.cs source.ContinueWith(t => { return collectionSelector(t.Result). ContinueWith(c => resultSelector(t.Result, c.Result), TaskContinuationOptions.NotOnCanceled); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
SwarmIntelligence LinqToTasks.cs outer.ContinueWith(delegate { var cts = new CancellationTokenSource(); return inner.ContinueWith(delegate { // Propagate all exceptions Task.WaitAll(outer, inner); // Both completed successfully, so if their keys are equal, return the result if (comparer.Equals(outerKeySelector(outer.Result), innerKeySelector(inner.Result))) { return resultSelector(outer.Result, inner.Result); } // Otherwise, cancel this task. else { cts.CancelAndThrow(); return default(TResult); // won't be reached } }, cts.Token, TaskContinuationOptions.NotOnCanceled, TaskScheduler.Default); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
SwarmIntelligence LinqToTasks.cs outer.ContinueWith(delegate { var cts = new CancellationTokenSource(); return inner.ContinueWith(delegate { // Propagate all exceptions Task.WaitAll(outer, inner); // Both completed successfully, so if their keys are equal, return the result if (comparer.Equals(outerKeySelector(outer.Result), innerKeySelector(inner.Result))) { return resultSelector(outer.Result, inner); } // Otherwise, cancel this task. else { cts.CancelAndThrow(); return default(TResult); // won't be reached } }, cts.Token, TaskContinuationOptions.NotOnCanceled, TaskScheduler.Default); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
kudu TaskExtensions.cs task.Unwrap() Link To Source File
ravendb HttpJsonRequest.cs Task.Factory.FromAsync(webRequest.BeginGetResponse, webRequest.EndGetResponse, null) .ContinueWith(task => ReadStringInternal(() => task.Result)) .ContinueWith(task => { var webException = task.Exception.ExtractSingleInnerException() as WebException; if (webException == null || retries >= 3) return task;// effectively throw var httpWebResponse = webException.Response as HttpWebResponse; if (httpWebResponse == null || httpWebResponse.StatusCode != HttpStatusCode.Unauthorized) return task; // effectively throw var authorizeResponse = HandleUnauthorizedResponseAsync(httpWebResponse); if (authorizeResponse == null) return task; // effectively throw return authorizeResponse .ContinueWith(_ => { _.Wait(); //throw on error return InternalReadResponseStringAsync(retries + 1); }) .Unwrap(); }).Unwrap() Link To Source File
ravendb HttpJsonRequest.cs authorizeResponse .ContinueWith(_ => { _.Wait(); //throw on error return InternalReadResponseStringAsync(retries + 1); }) .Unwrap() Link To Source File
ravendb AbstractDocumentQuery.cs ExecuteActualQueryAsync() .ContinueWith(t => ProcessEnumerator(t)) .Unwrap() Link To Source File
ravendb AbstractDocumentQuery.cs TaskEx.Delay(100) .ContinueWith(_ => ExecuteActualQueryAsync()) .Unwrap() Link To Source File
ravendb AbstractDocumentQuery.cs InitAsync() .ContinueWith(t => ProcessEnumerator(t)) .Unwrap() Link To Source File
ravendb TaskExtensions.cs parent.ContinueWith(task => { if (task.IsFaulted) { var exception = task.Exception.ExtractSingleInnerException(); if (exception is SecurityException) throw new WebException("Could not contact server./r/nGot security error because RavenDB wasn't able to contact the database to get ClientAccessPolicy.xml permission.", exception); } return task; }).Unwrap() Link To Source File
ravendb AsyncServerClient.cs httpJsonRequest.WriteAsync(postedData) .ContinueWith( task => { task.Wait();// will throw if write errored return httpJsonRequest.ReadResponseJsonAsync() .ContinueWith(replyTask => convention.CreateSerializer().Deserialize(new RavenJTokenReader(replyTask.Result))); }) .Unwrap() Link To Source File
ravendb AsyncServerClient.cs request.WriteAsync(document.ToString()) .ContinueWith(task => { if (task.Exception != null) throw new InvalidOperationException("Unable to write to server", task.Exception); return request.ReadResponseJsonAsync() .ContinueWith(task1 => { try { return convention.CreateSerializer().Deserialize(new RavenJTokenReader(task1.Result)); } catch (AggregateException e) { var webexception = e.ExtractSingleInnerException() as WebException; if (ShouldThrowForPutAsync(webexception)) throw; throw ThrowConcurrencyException(webexception); } catch (WebException e) { if (ShouldThrowForPutAsync(e)) throw; throw ThrowConcurrencyException(e); } }); }) .Unwrap() Link To Source File
ravendb AsyncServerClient.cs webRequest.ExecuteRequest() .ContinueWith(task => { try { task.Wait(); // should throw if it is bad if (overwrite == false) throw new InvalidOperationException("Cannot put index: " + name + ", index already exists"); } catch (AggregateException e) { var webException = e.ExtractSingleInnerException() as WebException; if (ShouldThrowForPutIndexAsync(webException)) throw; } catch (WebException e) { if (ShouldThrowForPutIndexAsync(e)) throw; } var request = jsonRequestFactory.CreateHttpJsonRequest(this, requestUri, "PUT", credentials, convention); request.AddOperationHeaders(OperationsHeaders); var serializeObject = JsonConvert.SerializeObject(indexDef, new JsonEnumConverter()); return request .WriteAsync(serializeObject) .ContinueWith(writeTask => AttemptToProcessResponse(() => request .ReadResponseJsonAsync() .ContinueWith(readStrTask => AttemptToProcessResponse(() => { //NOTE: JsonConvert.DeserializeAnonymousType() doesn't work in Silverlight because the ctor is private! var obj = convention.CreateSerializer().Deserialize(new RavenJTokenReader(readStrTask.Result)); return obj.Index; }))) ).Unwrap(); }).Unwrap() Link To Source File
ravendb AsyncServerClient.cs request .WriteAsync(serializeObject) .ContinueWith(writeTask => AttemptToProcessResponse(() => request .ReadResponseJsonAsync() .ContinueWith(readStrTask => AttemptToProcessResponse(() => { //NOTE: JsonConvert.DeserializeAnonymousType() doesn't work in Silverlight because the ctor is private! var obj = convention.CreateSerializer().Deserialize(new RavenJTokenReader(readStrTask.Result)); return obj.Index; }))) ).Unwrap() Link To Source File
ravendb AsyncServerClient.cs req.WriteAsync(jArray.ToString(Formatting.None)) .ContinueWith(writeTask => req.ReadResponseJsonAsync()) .Unwrap() Link To Source File
ravendb HttpJsonRequest.cs WaitForTask.ContinueWith(_ => webRequest .GetResponseAsync() .ConvertSecurityExceptionToServerNotFound() .AddUrlIfFaulting(webRequest.RequestUri) .ContinueWith(t => ReadStringInternal(() => t.Result)) .ContinueWith(task => RetryIfNeedTo(task, ReadResponseStringAsync)) .Unwrap()) .Unwrap() Link To Source File
ravendb HttpJsonRequest.cs webRequest .GetResponseAsync() .ConvertSecurityExceptionToServerNotFound() .AddUrlIfFaulting(webRequest.RequestUri) .ContinueWith(t => ReadStringInternal(() => t.Result)) .ContinueWith(task => RetryIfNeedTo(task, ReadResponseStringAsync)) .Unwrap() Link To Source File
ravendb HttpJsonRequest.cs authorizeResponse .ContinueWith(task1 => { task1.Wait();// throw if error return generator(); }) .Unwrap() Link To Source File
ravendb HttpJsonRequest.cs WaitForTask.ContinueWith(_ => webRequest .GetResponseAsync() .ConvertSecurityExceptionToServerNotFound() .AddUrlIfFaulting(webRequest.RequestUri) .ContinueWith(t => ReadResponse(() => t.Result, ConvertStreamToBytes)) .ContinueWith(task => RetryIfNeedTo(task, ReadResponseBytesAsync)) .Unwrap()) .Unwrap() Link To Source File
ravendb HttpJsonRequest.cs webRequest .GetResponseAsync() .ConvertSecurityExceptionToServerNotFound() .AddUrlIfFaulting(webRequest.RequestUri) .ContinueWith(t => ReadResponse(() => t.Result, ConvertStreamToBytes)) .ContinueWith(task => RetryIfNeedTo(task, ReadResponseBytesAsync)) .Unwrap() Link To Source File
WCell LinqToTasks.cs source.ContinueWith(t => selector(t.Result), TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
WCell LinqToTasks.cs source.ContinueWith(t => { return collectionSelector(t.Result). ContinueWith(c => resultSelector(t.Result, c.Result), TaskContinuationOptions.NotOnCanceled); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
WCell LinqToTasks.cs outer.ContinueWith(delegate { var cts = new CancellationTokenSource(); return inner.ContinueWith(delegate { // Propagate all exceptions Task.WaitAll(outer, inner); // Both completed successfully, so if their keys are equal, return the result if (comparer.Equals(outerKeySelector(outer.Result), innerKeySelector(inner.Result))) { return resultSelector(outer.Result, inner.Result); } // Otherwise, cancel this task. else { cts.CancelAndThrow(); return default(TResult); // won't be reached } }, cts.Token, TaskContinuationOptions.NotOnCanceled, TaskScheduler.Default); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File
WCell LinqToTasks.cs outer.ContinueWith(delegate { var cts = new CancellationTokenSource(); return inner.ContinueWith(delegate { // Propagate all exceptions Task.WaitAll(outer, inner); // Both completed successfully, so if their keys are equal, return the result if (comparer.Equals(outerKeySelector(outer.Result), innerKeySelector(inner.Result))) { return resultSelector(outer.Result, inner); } // Otherwise, cancel this task. else { cts.CancelAndThrow(); return default(TResult); // won't be reached } }, cts.Token, TaskContinuationOptions.NotOnCanceled, TaskScheduler.Default); }, TaskContinuationOptions.NotOnCanceled).Unwrap() Link To Source File