This project demonstrates how to run background tasks in ASP.NET Core using Channel
-based queues.
- Enqueue tasks via an API.
- Tasks are processed asynchronously in the background.
-
Clone the repository:
git clone https://github.com/yourusername/BackgroundTasksDemo.git
-
Navigate to the project directory:
cd BackgroundTasksDemo
-
Restore the NuGet packages and run the project:
dotnet restore dotnet run
Send a POST request to /api/queue/enqueue
to enqueue a background task. For example, using curl
:
curl -X POST http://localhost:5000/api/queue/enqueue
Adrián Bailador Panero Blog