Asynchronous Processing
C# Programming context
To understand what is Asynchronous Processing, the prerequisite is to understand what is Synchronous Processing.
Basically, there are two main things involved in this:- Client
- Server
Client: Sends the request to a server and keeps waiting until it receives the response. During the process, it keeps loading and needs a constant connection to the server.
Server: It processes the request received by the client and sends the response. If the process is long-running, sometimes the server goes out of memory or shows timeout error. Due to this, it is not suitable or recommended for long-running operations.
There are multiple problems with this approach... Let's discuss a few of them:
- Bad user experience
- The server needs to be very powerful as it may need to work on concurrent requests
- Server consumes a lot of resources
To overcome this problem, Microsoft .NET Framework 4.0 introduces a new Task Parallel Library (TPL) for parallel computing and asynchronous programming.
The namespace is "System.Threading.Tasks".
Here, we need to do it all manually. So this is again a tedious task.
So to solve this problem Microsoft came up with async / await in C# 5 in .Net 4.5 under System.Threading.Tasks.Task
This is pretty much good and could solve the issues like blocking client screen.
Asynchronous processing means "Fire & Forget"... Just sit back and wait...
This is the typical flow of Asynchronous processing. Here we are going to talk about the infrastructure provided by Azure for implementing the same.
Reference:
1. https://docs.microsoft.com/en-us/azure/architecture/patterns/async-request-reply
2. https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-async-messaging
3. https://www.c-sharpcorner.com/UploadFile/84c85b/asynchronous-programming-with-C-Sharp-5-0/
4. https://docs.plm.automation.siemens.com/content/pl4x/18.1/T4EA/en_US/Teamcenter_Gateway-Technical_Connectivity_Guide/synchronous_vs_asynchronous.html



Comments
Post a Comment