Skip to content
Tracon

JobTenantCap

Namespace Tracon · Assembly Tracon.Abstractions.dll

A ceiling on how many jobs of a set of handler keys one tenant may hold leased at the same time.

public sealed record JobTenantCap : IEquatable<JobTenantCap>
Inheritance
object ← JobTenantCap
Implements
IEquatable<JobTenantCap>
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

The store counts the tenant’s jobs whose handler key is in JobTenantCap.HandlerKeys and whose lease is alive (JobStatus.Leased or JobStatus.Running with a lease that has not expired), across every worker that shares the store. A tenant at the ceiling has its jobs of those keys skipped, and the oldest job that is still eligible is leased instead. A job of another handler key, or of another tenant, is never affected.

The ceiling is soft. Two workers that lease at the same moment can both read a count below the ceiling, so the tenant can exceed it by up to the number of workers leasing at once. It is a fairness limit that keeps one tenant from holding the whole queue, not a quota.

public JobTenantCap()

Gets the handler keys the ceiling applies to (see JobHandlerKeys). Not empty.

public required IReadOnlyList<string> HandlerKeys { get; init; }

IReadOnlyList<string>

Gets the most jobs of JobTenantCap.HandlerKeys one tenant may hold leased. At least one.

public required int MaxLeasedPerTenant { get; init; }

int

public override bool Equals(object? obj)

obj object?

bool

public bool Equals(JobTenantCap? other)

other JobTenantCap?

bool

public override int GetHashCode()

int

public override string ToString()

string

operator ==(JobTenantCap?, JobTenantCap?)

Section titled “ operator ==(JobTenantCap?, JobTenantCap?)”
public static bool operator ==(JobTenantCap? left, JobTenantCap? right)

left JobTenantCap?

right JobTenantCap?

bool

operator !=(JobTenantCap?, JobTenantCap?)

Section titled “ operator !=(JobTenantCap?, JobTenantCap?)”
public static bool operator !=(JobTenantCap? left, JobTenantCap? right)

left JobTenantCap?

right JobTenantCap?

bool