Interface IConnectionScope<TKey>
Auto reserves clients and manages their lifetimes.
Inherited Members
Namespace: Microsoft.XboxStudios.ClientManager
Assembly: ClientManager.Abstractions.dll
Syntax
public interface IConnectionScope<TKey> : ICanConnect<TKey>, IHoldsBaggage<TKey>, IAsyncDisposable, IDisposable where TKey : notnull
Type Parameters
Name | Description |
---|---|
TKey | The type of key to use. |
Methods
View SourceConnectAndGetBaggageAsync<TBaggage>(TKey, CancellationOptions?)
Connects if necessary and gets the baggage associated with a key.
Declaration
ValueTask<TBaggage> ConnectAndGetBaggageAsync<TBaggage>(TKey key, CancellationOptions? co = null)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The |
CancellationOptions? | co | The Microsoft.XboxStudios.Bifrost.CancellationOptions. |
Returns
Type | Description |
---|---|
ValueTask<TBaggage> | The baggage if possible. |
Type Parameters
Name | Description |
---|---|
TBaggage | The type of the baggage. |
Exceptions
Type | Condition |
---|---|
BaggageNullException | Thrown if the registered baggage factory returned null. |
ConnectionFailedException | Thrown if the connection could not be established. |
MissingBaggageFactoryException | Thrown if the baggage factory of the requested baggage is not registered. |
RemoveConnection(TKey)
Removes the connection associated with the key if active.
Declaration
void RemoveConnection(TKey key)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to remove the state for. |