Why call is ambiguous between ‘Task.Run(Func)’ and ‘Task.Run(Func) when passing method name
I am trying to have multiple non-async methods run at the same time as below. All functions are defined in the same class as member functions.
Run & Extract results of Tasks in Parallel based on Query Param
I have an API where client can request additional data of a resource with a query param as
Run & Extract Parallel Tasks in Parallel based on Query Param
I have an API where client can request additional data of a resource with a query param as
How can I catch an AggregateException? Copilot is telling me to return Task, but I already am
I’m trying to create an AggregateException
to observe some behavior. I’m getting en error here: “Cannot await void.” I’m not sure why. Copilot is telling me this:
C# – Why Does “WaitAll” Work when “await WhenAll” Doesn’t?
I have some code where I’m loading up a list of tasks, then calling await WhenAll on that list. The tasks don’t get run. When I convert the list to an array and pass it in to Task.WaitAll, they do run. The code looks kind of like this:
Task.WhenAll is not waiting
I have below code, which should wait 10seconds. Problem is that it completes immediately, the WhenAll
method is not working – what am I doing wrong here?
Curious about differences between two versions of code using await Task.Delay
The two code segments below lead to different outcomes – they’re intended to wait for a long-running task to complete. Completion of the task is signaled by the function ‘taskCompleted’. The task is not under direct control of the code that is waiting for it.
The intention is to just wait, while not locking up the UI.
Why does Channel work but BlockingCollection not?
As part of a much larger solution, I have a solution for the producer-consumer pattern in .NET. It uses a System.Threading.Channels.Channel
for receiving messages from a WebSocket and allowing it to be processed as the messages arrive.
Run multiple HTTP requests in parallel from a C# web API
I have a React page that shows a list of Azure resources. The data is retrieved by calling a C# controller. For each resource it takes around 30s to get all the related data. So if there are 10 resources on the page it takes 5min to load, which is too much.
How is the Task constructed in async methods under .NET Core
After reading this otherwise very in-depth blog post, I still cannot understand how the Task<TResult>
is really constructed before it is returned from the async method.