Skip to content

Api: Add background task queue#78

Open
losolio wants to merge 1 commit into
incendilabs:mainfrom
losol:feature/background-task-queue
Open

Api: Add background task queue#78
losolio wants to merge 1 commit into
incendilabs:mainfrom
losol:feature/background-task-queue

Conversation

@losolio
Copy link
Copy Markdown
Contributor

@losolio losolio commented May 17, 2026

Plumbing a new IBackgroundTaskQueue. No consumers wired up in this slice; the $archive-import PR will be the first user.

Copilot AI review requested due to automatic review settings May 17, 2026 19:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the initial API-side plumbing for an in-process background task queue that can run queued work items through a hosted service with per-item DI scopes.

Changes:

  • Introduces IBackgroundTaskQueue and a Channel-backed implementation.
  • Adds QueuedHostedService to drain queued work items and isolate each item in a DI scope.
  • Registers the queue/hosted service in Program.cs and adds unit tests for execution, scoped resolution, and failure isolation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Ignis.Api/Program.cs Registers the background task queue and hosted drainer.
src/Ignis.Api/Services/BackgroundTasks/IBackgroundTaskQueue.cs Defines the queue contract for producers and the hosted consumer.
src/Ignis.Api/Services/BackgroundTasks/BackgroundTaskQueue.cs Implements the queue with an unbounded single-reader channel.
src/Ignis.Api/Services/BackgroundTasks/QueuedHostedService.cs Runs queued delegates one at a time inside scoped service providers.
tests/Ignis.Api.Tests/BackgroundTaskQueueTests.cs Adds coverage for queued execution, scoped service resolution, and resilience after failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Ignis.Api/Services/BackgroundTasks/BackgroundTaskQueue.cs
Comment thread src/Ignis.Api/Services/BackgroundTasks/QueuedHostedService.cs Outdated
Introduces IBackgroundTaskQueue. No consumers wired up in this slice;
the $archive-import PR will be the first user.
@losolio losolio force-pushed the feature/background-task-queue branch from bdbaa51 to 462e5e4 Compare May 17, 2026 19:54
@losolio losolio requested a review from kennethmyhra May 17, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants