Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# HttpClient POST or PUT Json with content type application/json
- C# get results from Task.WhenAll
- C# Get expiry timestamp from JWT token
- Using C# HttpClient from Sync and Async code
- Run tasks in parallel using .NET Core, C# and async coding
- Handling "415 Unsupported Media Type" in .NET Core API
- c# Async fire and forget
Archive
Meta
Tag Archives: Asynchronous
Run parallel tasks in batches using .NET Core, C# and Async coding
If you have several tasks that you need to run, but each task takes up resources, it can be a good idea to run the tasks in batches. There are a few tools out there, and one of them is … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged .NET Core, Asynchronous, Semaphore
Leave a comment
Write to file from multiple threads async with C# and .NET Core
There are several patterns on how to allow multiple threads to write to the same file. the ReaderWriterLock class is invented for this purpose. Another classic is using semaphors and the lock statement to lock a shared resource. This article … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged .NET, .NET Core, Asynchronous, ConcurrentQueue, Multithreading
4 Comments
Run tasks in parallel using .NET Core, C# and async coding
If you have several tasks that can be run in parallel, but still need to wait for all the tasks to end, you can easily achieve this using the Task.WhenAll() method in .NET Core. Imagine you have this imaginary method … Continue reading
Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the ‘await’ operator to the result of the call
This C# warning occurs if you call an async method from your non-async code. Imagine you have this imaginary async method: And you call the method from this imaginary non-async method: The compiler will warn you with the following message: … Continue reading
Posted in .net, .NET Core, c#, General .NET, Microsoft Azure
Tagged Asynchronous, Await, c#, Discards
Leave a comment
c# Async fire and forget
Often in application development you want a process to call another thread and continue the process flow, without waiting for a response from the called thread. This pattern is called the “fire and forget” pattern. I myself are oblivious to … Continue reading
Using C# HttpClient from Sync and Async code
The .NEt 4.5 C# System.Net.Http.HttpClient() is a very nice http client implementation, but can be tricky to use if you (like me) are not a trained asynchronous programming coder. So here is a quick cheat sheet on how to work … Continue reading