Class ServiceRoles
- Namespace
- Integrations.Api.Hosting
- Assembly
- Integrations.Api.dll
One image, two roles. Api serves HTTP; Worker runs message consumers and scheduled jobs.
Kubernetes runs them as separate Deployments; locally both run in one process.
public sealed class ServiceRoles
- Inheritance
-
ServiceRoles
- Inherited Members
Fields
Section
Configuration section (Integrations:Roles, Integrations:Jobs).
public const string Section = "Integrations"
Field Value
Properties
Api
Serve the HTTP API.
public bool Api { get; init; }
Property Value
Jobs
Schedule background jobs in the Worker role (Integrations:Jobs, default true). Tests turn it off.
public bool Jobs { get; init; }
Property Value
Worker
Run message consumers and (when Jobs is on) scheduled jobs.
public bool Worker { get; init; }
Property Value
Methods
From(IConfiguration)
Reads Integrations:Roles (comma-separated Api, Worker); both roles when it is not set.
public static ServiceRoles From(IConfiguration configuration)
Parameters
configurationIConfiguration