Skip to content

Distributed .NET Aspire

Split Immediate.Jobs across an API, a CLI and a worker that share PostgreSQL storage.

1 min read

The distributed .NET Aspire sample runs Immediate.Jobs across separate processes that share one PostgreSQL database through EF Core storage in distributed mode:

  • the API applies migrations and hosts the Immediate.Jobs dashboard, Scalar, health checks and Aspire telemetry links. It calls DisableWorkers(), so it never executes jobs;
  • the CLI prepares data and enqueues a batch that processes it. It also calls DisableWorkers() and exits once the batch is committed. Aspire starts it on demand;
  • the worker is a plain host with the scheduler enabled. It runs the batch jobs concurrently with fair queues and a longer polling interval.

Use it as a starting point for deployments where web, tooling and background processing scale separately.

View the distributed .NET Aspire sample on GitHub

Browse the AppHost, API, CLI, worker and shared job projects.