By now, I have shown the following usages of delegates... Callback and Multicast delegatesEventsOne more EventAsynchronous Callback - Way 1 - BeginInvoke > EndInvokeAsynchronous Callback - Way 2 - BeginInvoke > AsyncWaitHandle.WaitOne(x) > EndInv…
This is the final part of the series that started with... Callback and Multicast delegatesOne more EventAsynchronous Callback - Way 1 - BeginInvoke > EndInvokeAsynchronous Callback - Way 2 - BeginInvoke > AsyncWaitHandle.WaitOne(x) > EndInvoke &g…
So far, I have discussed about Callback, Multicast delegates, Events using delegates, and yet another example of events using delegates. In this post, I will take this topic one step forward and show you an example of Asynchronous callbacks using del…
In this part of making asynchronous programming with delegates, we will talk about a different way, which is a little better than Way 1. In the previous post, it was like a husband telling his wife... You know honey, I have a lot of work to do. Why d…
两个线程执行任务有同步和异步之分,看了Quora上的一些问答有了更深的认识. When you execute something synchronously, you wait for it to finish before moving on to another task. When you execute something asynchronously, you can move on to another task before it finishes. Synchronized m…
I hear a lot of confusion around Delegates in C#, and today I am going to give it shot of explaining the stuff with easy to understand examples. First things first... I will consciously try NOT to use any technical jargon to explain this concept. So…
In my previous post, I spoke about a few very basic and simple reasons of using delegates - primarily callback. In this post, I'll talk about creating Events using delegates. I have tried to annotate the class with comments so that it is easy to comp…
I was thinking that the previous post on Events and Delegates was quite self-explanatory. A couple of days ago, I received an email which said that may be it is not that good as to explain what I want to achieve in life through that event. So, I thou…
Learn how to write a promise based delay function and then use it in async await to see how much it simplifies code over setTimeout. Lets say you want to call a function after 1s, 2s, 3s. You can use setTimeout, or you can wrap it up into a simple de…
People often find it difficult to see the difference between events and delegates. C# doesn't help matters by allowing you to declare field-like events which are automatically backed by a delegate variable of the same name. This article aims to clari…