# JobTenantCap

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.jobtenantcap/
> Summary: JobTenantCap: A ceiling on how many jobs of a set of handler keys one tenant may hold leased at the same time.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

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

```csharp
public sealed record JobTenantCap : IEquatable<JobTenantCap>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.jobtenantcap/">JobTenantCap</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;JobTenantCap&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

The store counts the tenant's jobs whose handler key is in [JobTenantCap.HandlerKeys](/api/tracon.jobtenantcap/#Tracon_JobTenantCap_HandlerKeys) and
whose lease is alive ([JobStatus.Leased](/api/tracon.jobstatus/) or [JobStatus.Running](/api/tracon.jobstatus/)
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.

## Constructors

### <a id="Tracon_JobTenantCap__ctor"></a> JobTenantCap\(\)

```csharp
public JobTenantCap()
```

## Properties

### <a id="Tracon_JobTenantCap_HandlerKeys"></a> HandlerKeys

Gets the handler keys the ceiling applies to (see [JobHandlerKeys](/api/tracon.jobhandlerkeys/)). Not empty.

```csharp
public required IReadOnlyList<string> HandlerKeys { get; init; }
```

#### Property Value

 [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>

### <a id="Tracon_JobTenantCap_MaxLeasedPerTenant"></a> MaxLeasedPerTenant

Gets the most jobs of [JobTenantCap.HandlerKeys](/api/tracon.jobtenantcap/#Tracon_JobTenantCap_HandlerKeys) one tenant may hold leased. At least one.

```csharp
public required int MaxLeasedPerTenant { get; init; }
```

#### Property Value

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

## Methods

### <a id="Tracon_JobTenantCap_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_JobTenantCap_Equals_Tracon_JobTenantCap_"></a> Equals\(JobTenantCap?\)

```csharp
public bool Equals(JobTenantCap? other)
```

#### Parameters

`other` [JobTenantCap](/api/tracon.jobtenantcap/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_JobTenantCap_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_JobTenantCap_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_JobTenantCap_op_Equality_Tracon_JobTenantCap_Tracon_JobTenantCap_"></a> operator ==\(JobTenantCap?, JobTenantCap?\)

```csharp
public static bool operator ==(JobTenantCap? left, JobTenantCap? right)
```

#### Parameters

`left` [JobTenantCap](/api/tracon.jobtenantcap/)?

`right` [JobTenantCap](/api/tracon.jobtenantcap/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_JobTenantCap_op_Inequality_Tracon_JobTenantCap_Tracon_JobTenantCap_"></a> operator \!=\(JobTenantCap?, JobTenantCap?\)

```csharp
public static bool operator !=(JobTenantCap? left, JobTenantCap? right)
```

#### Parameters

`left` [JobTenantCap](/api/tracon.jobtenantcap/)?

`right` [JobTenantCap](/api/tracon.jobtenantcap/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
