Background Service

A Background Service is hosted code that runs outside the request pipeline in ASP.NET Core for queues, schedulers, sync jobs and workers.

Background services run outside the web request/response cycle (e.g. scheduled tasks, queues, data sync, email sending).

  • Implemented using IHostedService / BackgroundService
  • Safer than firing Task.Run in a request
  • Can be scaled separately as a worker