#### [Abblix\.Oidc\.Server\.SharedSignals](https://www.abblix.com/docs/api/abblix-oidc-server-sharedsignals 'index')
### [Abblix\.Oidc\.Server\.SharedSignals](https://www.abblix.com/docs/api/abblix-oidc-server-sharedsignals/Abblix.Oidc.Server.SharedSignals 'Abblix\.Oidc\.Server\.SharedSignals')

## TenantStreamsClosing Class

Deletes the streams a released tenant's receivers created, and the events queued on them\.

```csharp
public sealed class TenantStreamsClosing : Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing
```

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

Implements [ITenantClosing](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantClosing')

### Remarks
Runs through the released tenant's own transmitter, in the definition last served for that creation, so it
reaches that creation's streams in the store they were kept in and no other's: a tenant created again under the same id keeps its own\.
Each stream is deleted on its own, so one that fails is logged, the others are still deleted and the tenant is
reported not closed; once the token is canceled, the streams and tenants not reached are left and reported\. The
transmitters are resolved when a tenant is closed rather than when the catalog of tenants is built, since they
depend on that catalog\.
### Constructors

## TenantStreamsClosing\(ILogger\<TenantStreamsClosing\>, IServiceProvider\) Constructor {#Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing.TenantStreamsClosing(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing_,System.IServiceProvider)}

Deletes the streams a released tenant's receivers created, and the events queued on them\.

```csharp
public TenantStreamsClosing(Microsoft.Extensions.Logging.ILogger<Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing> logger, System.IServiceProvider serviceProvider);
```
#### Parameters

###### `logger` [Microsoft\.Extensions\.Logging\.ILogger&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1')[TenantStreamsClosing](https://www.abblix.com/docs/api/abblix-oidc-server-sharedsignals/Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing 'Abblix\.Oidc\.Server\.SharedSignals\.TenantStreamsClosing')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.ilogger-1 'Microsoft\.Extensions\.Logging\.ILogger\`1') {#Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing.TenantStreamsClosing(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing_,System.IServiceProvider).logger}

Records a stream that could not be deleted\.

###### `serviceProvider` [System\.IServiceProvider](https://learn.microsoft.com/en-us/dotnet/api/system.iserviceprovider 'System\.IServiceProvider') {#Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing.TenantStreamsClosing(Microsoft.Extensions.Logging.ILogger_Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing_,System.IServiceProvider).serviceProvider}

Resolves the transmitter of each tenant\.

### Remarks
Runs through the released tenant's own transmitter, in the definition last served for that creation, so it
reaches that creation's streams in the store they were kept in and no other's: a tenant created again under the same id keeps its own\.
Each stream is deleted on its own, so one that fails is logged, the others are still deleted and the tenant is
reported not closed; once the token is canceled, the streams and tenants not reached are left and reported\. The
transmitters are resolved when a tenant is closed rather than when the catalog of tenants is built, since they
depend on that catalog\.
### Methods

## TenantStreamsClosing\.CloseAsync\(IReadOnlyCollection\<TenantDefinition\>, CancellationToken\) Method {#Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken)}

Lets go of what each of [tenants](https://www.abblix.com/docs/api/abblix-oidc-server-sharedsignals/Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing#Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).tenants 'Abblix\.Oidc\.Server\.SharedSignals\.TenantStreamsClosing\.CloseAsync\(System\.Collections\.Generic\.IReadOnlyCollection\<Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition\>, System\.Threading\.CancellationToken\)\.tenants') kept, each one on its own, so one that fails leaves the
others closed\.

```csharp
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyDictionary<Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition,System.Exception>> CloseAsync(System.Collections.Generic.IReadOnlyCollection<Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition> tenants, System.Threading.CancellationToken cancellationToken);
```
#### Parameters

###### `tenants` [System\.Collections\.Generic\.IReadOnlyCollection&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlycollection-1 'System\.Collections\.Generic\.IReadOnlyCollection\`1')[TenantDefinition](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlycollection-1 'System\.Collections\.Generic\.IReadOnlyCollection\`1') {#Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).tenants}

The tenants released, each in the creation that was served\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Oidc.Server.SharedSignals.TenantStreamsClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken).cancellationToken}

Cancels the closing\.

Implements [CloseAsync\(IReadOnlyCollection&lt;TenantDefinition&gt;, CancellationToken\)](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing#Abblix.Oidc.Server.Features.MultiTenancy.ITenantClosing.CloseAsync(System.Collections.Generic.IReadOnlyCollection_Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition_,System.Threading.CancellationToken) 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantClosing\.CloseAsync\(System\.Collections\.Generic\.IReadOnlyCollection\{Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition\},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\.Collections\.Generic\.IReadOnlyDictionary&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[TenantDefinition](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.TenantDefinition 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantDefinition')[,](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[System\.Exception](https://learn.microsoft.com/en-us/dotnet/api/system.exception 'System\.Exception')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ireadonlydictionary-2 'System\.Collections\.Generic\.IReadOnlyDictionary\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
Why each tenant that could not be closed, wholly or in part, was not, by the definition it was handed
            in; the others are closed\.
