Linked Questions

10 votes
3 answers
268 views

For example, the difference between this code public Task<IList<NewsSentimentIndexes>> GetNewsSentimentIndexes(DateTime @from, DateTime to = new DateTime(), string grouping = "1h&...
Bleg Bleg's user avatar
  • 395
1 vote
1 answer
440 views

Possible Duplicate: Is Async await keyword equivalent to a ContinueWith lambda? Edit: I see this question has been marked as a duplicate, but it's not quite the same. I'm specifically asking about ...
NoPyGod's user avatar
  • 5,097
167 votes
2 answers
82k views

Can someone explain if await and ContinueWith are synonymous or not in the following example. I'm trying to use TPL for the first time and have been reading all the documentation, but don't understand ...
Harrison's user avatar
  • 3,983
60 votes
3 answers
19k views

e.g. class Foo { public async Task Bar() { await Task.Delay(500); } } If we are reflecting over this class and method, how can I determine if this is an actual async/await method rather than simply a ...
Isaac Abraham's user avatar
52 votes
3 answers
76k views

I have read a lot of articles and still cant get understand this part. Consider this code : private async void button1_Click(object sender, EventArgs e) { await Dosomething(); } ...
syncis's user avatar
  • 603
20 votes
1 answer
35k views

I'm calling an async method within my console application. I don't want the app to quit shortly after it starts, i.e. before the awaitable tasks complete. It seems like I can do this: internal ...
rory.ap's user avatar
  • 35.7k
5 votes
3 answers
2k views

Consider the following code: public Task SomeAsyncMethod() { var tcs = new TaskCompletionSource(); ... do something, NOT setting the TaskCompletionSource... return tcs.Task } public ...
Daniel C. Weber's user avatar
8 votes
1 answer
24k views

I asked a question yesterday and the answer was good. But now I'm trying to understand the role of await and how task execution works. I've read about await that: The await operator is applied to a ...
Buda Gavril's user avatar
  • 21.7k
15 votes
1 answer
1k views

I was wondering what is the best/correct way of writing asynchronous code that is composed of two (or more) async and dependent (the first have to finish to execute second) operations. Example with ...
Aleksander Bethke's user avatar
5 votes
2 answers
6k views

I have questions regarding the execution order of async jobs. I will ask my question with example because it is easier to be understandable. It is an official example from https://msdn.microsoft.com/...
derek's user avatar
  • 10.5k
1 vote
2 answers
2k views

I am trying to chain Task<T> objects in C# as done in JavaScript and without blocking the UI thread. I see there is a similar question here, but it uses the non-generic Task object as a return ...
NoOne's user avatar
  • 4,101
3 votes
2 answers
790 views

I create a task with continuationWith(anotherTask) as below. I want to find out the time taken for completing its work by the first task. I share the variable "task1StartedDateTime" between task1 and ...
Satheesh K's user avatar
3 votes
3 answers
606 views

Supposing a Task is created and awaited multiple times from a single thread. Is the resume order FIFO? Simplistic example: Is the Debug.Assert() really an invariant? Task _longRunningTask; async ...
antak's user avatar
  • 21.2k
2 votes
3 answers
112 views

I accidentally bumped into an issue, that I was able to resolve. However, I am a worried about my inability to understand why the error-ed code was able to compile (at first place). Following is the ...
Oxyprogrammer's user avatar
1 vote
1 answer
97 views

Picture the following code: var client = new HttpClient(); var response = await client.GetAsync("www.someaddress.yo"); string content = await response.Content.ReadAsStringAsync(); Is there any added ...
SpiritBob's user avatar
  • 2,762