Linked Questions

23 votes
3 answers
38k views

I have a Windows Service that runs various jobs based on a schedule. After determining which jobs to run, a list of schedule objects is sent to a method that iterates through list and runs each job. ...
Josh's user avatar
  • 8,551
7 votes
1 answer
2k views

I have a situation where I want to fire off a user-defined number of tasks asynchronously and wait for all of them to complete. Simplified, here's what I'm dealing with: [TestMethod] public async ...
SB2055's user avatar
  • 13k
-4 votes
1 answer
1k views

Consider this code on a console application written with vs 2015: using System; using System.Threading.Tasks; public class Example { public static void Main() { Console.WriteLine("...
user3352251's user avatar
0 votes
1 answer
329 views

I have an application where I need to do two I/O tasks: get a GPS location, retrieve some data over Bluetooth. Both tasks can vary in time to complete, and can take many seconds. To improve the speed ...
gregm's user avatar
  • 361
0 votes
3 answers
1k views

I have a method in which I'm retrieving a list of deployments. For each deployment I want to retrieve an associated release. Because all calls are made to an external API, I now have a foreach-loop in ...
ZiNNED's user avatar
  • 2,640
0 votes
1 answer
376 views

I have the following piece of code (changed the names of my classes/objects for brevity). It essentially is hitting an external API that allows only a single operation, but my service code will expose ...
TheJediCowboy's user avatar
0 votes
1 answer
539 views

I have a scenario where in My .Net Standard project,I have a api public async Task SendMessageAsync(){ await _service1.SendmessageToRestServiceAsync(); - calls a rest service await _service2....
Yashwanth Kata's user avatar
-1 votes
1 answer
541 views

I need help understanding how Task work in c#. I want to call ExecuteClause once for every clause in clauses. I've figured out that I should create a list of tasks and then await Task.WhenAll(...
Asken's user avatar
  • 8,147
-2 votes
1 answer
117 views

I am trying to start a count and then another method will stop this counting by generating a random number between 1 and 6 seconds. I can do the counting but stopper function did not start ...
Lyrk's user avatar
  • 2,050
0 votes
0 answers
33 views

Suppose we have this scenario: In a database, there are Car1, Car2, Car3. To get these objects, we will do three queries. But, instead doing : Car car1 = await ApiHelper.GetCar1(); Car car1 = await ...
Alex Huiculescu's user avatar
0 votes
0 answers
31 views

Im trying to run a list of HttpRequest tasks parallelly (not just asynchronously), and Only after all tasks are completed- output results. But when i run my code it doesnt wait but run the whole ...
MTX20200's user avatar
318 votes
11 answers
303k views

I would like to handle a collection in parallel, but I'm having trouble implementing it and I'm therefore hoping for some help. The trouble arises if I want to call a method marked async in C#, ...
clausndk's user avatar
  • 3,469
539 votes
4 answers
205k views

What is the difference between Task.WaitAll() and Task.WhenAll() from the Async CTP? Can you provide some sample code to illustrate the different use cases?
Yaron Levi's user avatar
  • 13.2k
10 votes
3 answers
3k views

I am currently optimizing an existing, very slow and timing out production application. There is no option to re-write it. In short, it is a WCF service that currently calls 4 other "worker" WCF ...
tinonetic's user avatar
  • 8,034
9 votes
2 answers
1k views

I've been trying to learn C#'s async with HttpClient and have come across an issue where I can't figure out what's happening. What I want to do: Send multiple HttpClient requests in one go and have ...
undercurrent's user avatar

15 30 50 per page