Skip to content

Worker Template — organizational overview (ConnectSoft.WorkerTemplate)

Layer 3 template for long-running and asynchronous work: scheduled jobs, queue consumers, outbox processors, and (where enabled) distributed compute such as Orleans. It uses the base-template/ submodule and the same MSBuild and ops conventions as other extended templates—for example the Identity Backend—so platform teams can deploy and observe it like any other ConnectSoft service.

Why use this template

  • Keeps web APIs thin: heavy, slow, or retriable work moves off the request thread into a purpose-built host with clearer scaling story.
  • Reliable processing: recurring schedules, backoff, and idempotency patterns fit worker topologies better than cramming everything into HTTP handlers.
  • Operational consistency: logging, configuration, health endpoints, and packaging align with the Base Template program—fewer one-off runbooks per team.
  • Product velocity: new queues, schedules, or background sagas start from a maintained skeleton instead of a blank console app.

Typical use cases

  • Nightly or hourly batches: reporting, data sync, cleanup, and reconciliation jobs with monitoring and restart-friendly behavior.
  • Message-driven workflows: consume from a broker or internal outbox, process domain events, and trigger downstream actions.
  • Reminder and SLA timers: delayed jobs, retries, and workflows that must survive deploys and restarts (often paired with HangFire-style scheduling when enabled).
  • Distributed state and grains (when Orleans is enabled): session affinity, actor-style modeling, or scale-out compute that should not live inside a single API process.

Capabilities (what you get)

  • Worker-oriented host with patterns for HangFire (and related storage), messaging hooks, and optional Orleans integration—exact flags and dependencies are in the technical docs and repo template config.
  • Same layering discipline as other ConnectSoft services: clear boundaries between hosting, application logic, and infrastructure adapters.
  • Docker and local-dev parity patterns: teams commonly align Deployment/docker-compose/ and appsettings.Docker.json with Identity-style hosts for predictable environments.
  • Configuration tokens aligned with the extended-template program (e.g., database and Orleans catalog naming consistent with configuration alignment).

dotnet new

  • Short name: connectsoft-worker (always verify in the repo’s .template.config/template.json).

Also useful internally

Forked products usually rename src/ConnectSoft.WorkerTemplate.* to their own root namespace while keeping the same structural skeleton.

Technical documentation (single hub)

Scaffolding, architecture, parameters, configuration, testing, and operational notes for this template are maintained in ConnectSoft.Documentation (this company page stays outcome-oriented).

Worker Template — technical hub (ConnectSoft.Documentation)