Intro In this post of the concurrency series we will provide insights on asynchronous programming. So what is asynchrony? Succinctly, is about not blocking the thread that initiates an operation. The key difference between synchronous and asynchronous is that the latter can start a new operation before the first one completes. For example, a user clicks on a button to fetch…
Publish Angular 2 App from Visual Studio to Azure
In this post i will share my experience on how to deploy an Angular 2 app from Visual Studio to Azure. This is one way that worked for me, if you know a simpler way please share it. I am pretty sure most of us when started learning Angular 2 have came across the 5 MIN QUICKSTART. So…
Prism: Why Service Locator Matters with Multiple Shells
Scenario You are working on a WPF composite application built with Prism bootstrapped with UnityBoostrapper, and you try to launch a second isolated/standalone WPF Prism composite app also bootstrapped with UnityBoostrapper, so the two windows are open at the same time. At this stage the second window is behaving properly i.e. views get navigated to the appropriate regions. So…
The Janus Task Class
Intro The msdn API reference defines the Task class as a representation of an asynchronous operation. However, as soon as you start writing Task based code for asynchronous/parallel programming, or simply offloading work to a thread pool thread, it becomes obvious that Task has more than one face based on the use case.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
/* 1- Offloading work to a ThreadPool thread */ Task<int> task = new Task<int>(() => SumMethod()); public int SumMethod() { int sum; //... return sum; } /* 2- Asynchronous */ int task = await SumMethodAsync(); public Task<int> SumMethodAsync() { int sum; //... return sum; } |
Task Faces Active…