Background Processing With Channels

I recently came across a scenario, where I had to process a lot of incoming data in real time, where missing a single entry is not an option. At the same time I wanted to disconnect the class which was fetching data (the collector) from the class which were processing the data (the processor). The result was a combination of Channels and the BackgroundService. Before we look at the code, you will need the Microsoft.Extensions.Hosting Nuget package. You can install it with: ...

April 15, 2025 · 3 min