#### [Abblix\.SharedSignals](https://www.abblix.com/en/docs/api/abblix-sharedsignals 'index')
### [Abblix\.SharedSignals\.Transmitter](https://www.abblix.com/en/docs/api/abblix-sharedsignals/Abblix.SharedSignals.Transmitter 'Abblix\.SharedSignals\.Transmitter')

## ProcessLocalDeliveryLease Class

The lease inside one process, which is the whole of its reach: it excludes the threads of this
instance from each other and nothing else\. A second instance of the application holds its own
dictionary and sees none of these claims, so every instance believes it holds every lease\.

```csharp
public sealed class ProcessLocalDeliveryLease : Abblix.SharedSignals.Transmitter.IDeliveryLease
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → ProcessLocalDeliveryLease

Implements [IDeliveryLease](https://www.abblix.com/en/docs/api/abblix-sharedsignals/Abblix.SharedSignals.Transmitter.IDeliveryLease 'Abblix\.SharedSignals\.Transmitter\.IDeliveryLease')

### Remarks
The name says the boundary because that is the only thing a reader must not get wrong\. It is
the honest default for a single instance and for tests, and it is the wrong one the moment a
deployment scales out \- `AddSharedSignalsRedisDeliveryLease` is the implementation that spans
instances, and a deployment already sharing its outbox needs it\.
### Constructors

## ProcessLocalDeliveryLease\(TimeProvider\) Constructor {#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.ProcessLocalDeliveryLease(System.TimeProvider)}

The lease inside one process, which is the whole of its reach: it excludes the threads of this
instance from each other and nothing else\. A second instance of the application holds its own
dictionary and sees none of these claims, so every instance believes it holds every lease\.

```csharp
public ProcessLocalDeliveryLease(System.TimeProvider timeProvider);
```
#### Parameters

###### `timeProvider` [System\.TimeProvider](https://learn.microsoft.com/en-us/dotnet/api/system.timeprovider 'System\.TimeProvider') {#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.ProcessLocalDeliveryLease(System.TimeProvider).timeProvider}

The clock the deadlines are read from; a test hands in a fake\.

### Remarks
The name says the boundary because that is the only thing a reader must not get wrong\. It is
the honest default for a single instance and for tests, and it is the wrong one the moment a
deployment scales out \- `AddSharedSignalsRedisDeliveryLease` is the implementation that spans
instances, and a deployment already sharing its outbox needs it\.
### Methods

## ProcessLocalDeliveryLease\.TryAcquireAsync\(string, TimeSpan, CancellationToken\) Method {#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.TryAcquireAsync(string,System.TimeSpan,System.Threading.CancellationToken)}

Claims [name](https://www.abblix.com/en/docs/api/abblix-sharedsignals/Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.TryAcquireAsync(string,System.TimeSpan,System.Threading.CancellationToken).name 'Abblix\.SharedSignals\.Transmitter\.ProcessLocalDeliveryLease\.TryAcquireAsync\(string, System\.TimeSpan, System\.Threading\.CancellationToken\)\.name') for at most [duration](https://www.abblix.com/en/docs/api/abblix-sharedsignals/Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.TryAcquireAsync(string,System.TimeSpan,System.Threading.CancellationToken).duration 'Abblix\.SharedSignals\.Transmitter\.ProcessLocalDeliveryLease\.TryAcquireAsync\(string, System\.TimeSpan, System\.Threading\.CancellationToken\)\.duration')\.

```csharp
public System.Threading.Tasks.Task<System.IAsyncDisposable?> TryAcquireAsync(string name, System.TimeSpan duration, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
```
#### Parameters

###### `name` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.TryAcquireAsync(string,System.TimeSpan,System.Threading.CancellationToken).name}

What is being claimed\. Callers scope it themselves, so two kinds of work over one stream do
not collide\.

###### `duration` [System\.TimeSpan](https://learn.microsoft.com/en-us/dotnet/api/system.timespan 'System\.TimeSpan') {#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.TryAcquireAsync(string,System.TimeSpan,System.Threading.CancellationToken).duration}

How long the claim holds without being released\. It bounds two opposite costs: too short
cuts a legitimate pass off and the work is redone next time, too long parks the work for
the remainder after the holder dies\. Both are safe, so err on whichever the deployment
minds less\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.SharedSignals.Transmitter.ProcessLocalDeliveryLease.TryAcquireAsync(string,System.TimeSpan,System.Threading.CancellationToken).cancellationToken}

Cancels the I/O a shared implementation performs\.

Implements [TryAcquireAsync\(string, TimeSpan, CancellationToken\)](https://www.abblix.com/en/docs/api/abblix-sharedsignals/Abblix.SharedSignals.Transmitter.IDeliveryLease#Abblix.SharedSignals.Transmitter.IDeliveryLease.TryAcquireAsync(string,System.TimeSpan,System.Threading.CancellationToken) 'Abblix\.SharedSignals\.Transmitter\.IDeliveryLease\.TryAcquireAsync\(string, System\.TimeSpan, System\.Threading\.CancellationToken\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[System\.IAsyncDisposable](https://learn.microsoft.com/en-us/dotnet/api/system.iasyncdisposable 'System\.IAsyncDisposable')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A handle that releases the claim when disposed, or null when someone else holds it \- which
is an ordinary outcome and not a failure\. Releasing is conditional on still holding it, so
a handle disposed after its deadline cannot revoke the claim of whoever took over\.
