Skip to main content
Filter by
Sorted by
Tagged with
4 votes
2 answers
81 views

I have this code that I would like to chain using ContinueWith For e.g. overAllTask = await ParseLogLine(logLine) .ContinueWith(logModelTask => NormalizeParsedData(logModelTask)) ....
randomProg's user avatar
0 votes
1 answer
128 views

I have the following C# code : var rand = new Random(1); var range = Enumerable.Range(1, 8); var partition = Partitioner.Create(range, EnumerablePartitionerOptions.NoBuffering); foreach (var x in ...
tigrou's user avatar
  • 4,586
1 vote
2 answers
193 views

I have some code in a dll project with the target as .Net 8. In my code there is an async method called EmailNonError which is being called with the following code. When this code executes, the email ...
Sunil's user avatar
  • 21.6k
0 votes
1 answer
64 views

The first exception does not block the execution: public static async Task Main() { await Task.WhenAny( Task.WhenAll( Task.Run(() => throw new Exception(&...
user26757851's user avatar
0 votes
0 answers
117 views

Here's my example code. It's of no use, but it's short. I have an array to switch on or off the creation of Exceptions at different parts of my code and two functions. The first (Level 0) is an ...
Nostromo's user avatar
  • 1,364
0 votes
2 answers
103 views

For the following code snippets, I'm wondering what the actual differences are, when they are executed. The first snippet using await: public async Task LoadAsync() { task = loader.LoadAsync(...); ...
uebe's user avatar
  • 548
1 vote
1 answer
154 views

I'm trying to understand how exception handling works with TaskCompletionSource and await in a console application (which has no SynchronizationContext). I've written simple code that waits for a ...
Hello World's user avatar
0 votes
1 answer
235 views

See below for complete minimal repro (net9 console project). When it deadlocks, and I attach a debugger, I can see that the only input task to the whenAllTask is completed, yet the whenAllTask itself ...
Balinth's user avatar
  • 578
2 votes
1 answer
148 views

Take the example below with the new Task.WhenEach method List<Task<List<int>>> tasks = [ MyTask() ]; await foreach (var task in Task.WhenEach(tasks)) { var result = await ...
schgab's user avatar
  • 696
0 votes
1 answer
99 views

I've got some code which uses AsParallel().ForAll(...) which I was led to believe would block while all of the executions completed. This works perfectly with non async code. For example the below ...
GoldieLocks's user avatar
2 votes
1 answer
210 views

I want to wrap a Task in a Task<TResult> without using an async state machine, while preserving the original task's properties. Based on What's the best way to wrap a Task as a Task<TResult&...
Ivan Petrov's user avatar
  • 7,772
0 votes
0 answers
60 views

I have an override method which looks like this: public override Task Start(CancellationToken cancellationToken) { return Task.Delay(1000,cancellationToken); } However the abstract class ...
Mr. Boy's user avatar
  • 64.7k
1 vote
3 answers
302 views

Building a basic ASP.NET Core Minimal API, I was surprised by the fact that if an endpoint returns a Task, the request does not return until the Task is done: var builder = WebApplication....
Pragmateek's user avatar
  • 13.6k
1 vote
2 answers
117 views

The doc listed the operators in the table that ToArray should be unordered when the parallelquery source is unordered. However, the result turned out to be always ordered when force evaluated to array ...
jamgoo's user avatar
  • 107
0 votes
2 answers
120 views

I'm a little bit annoyed of parentheses in situations like this: var items = (await SomeService.GetDataAsEnumerableAsync()).ToList(); So I thought of creating an extension method like: public static ...
David Ritter's user avatar

15 30 50 per page
1
2 3 4 5
420