Asynchronous (dotnet)

Asynchronous

What does asynchronous even mean?

In programming they are actions which don't necesserly have a fixed time for completion or a coordination in time. For example, let's say you wrote a friend on WhatsApp. Your Friend might immediately respond, but maybe he will respond in 2 hours. Asynchronous actions are exactly that. In a Database for example, the DB might take longer to query, when it got more data or is used a lot at the same time. So in the meanwhile another process can continue running, while the DB is being queried.

Another explanation (How Microsoft describes it): When you are preparing Breakfast, you want some coffee, scrambled eggs and orange juice. This can be done in an asynchronous way. You can start frying your eggs, after starting you go make the coffee, in the meannwhile the egg is done and you get it off and start pouring in the orange juive and at the end the coffee is done. This is efficient.

The opposite of that would be synchronous actions, an example where this is used are in File transferring processes. There when a file is being transferred, a confirmation needs to be sent out, before the next file can be copied.

Advantages

  1. It can improve the UX, as the application is still able to communicate / react, while doing the action on databases