Interface IConnectable<T>
Represents a connection.
Inherited Members
Namespace: Microsoft.XboxStudios.DeviceConsole.Connections
Assembly: DeviceConsole.Abstractions.dll
Syntax
public interface IConnectable<T> : IConnectable, IHasConnectionStatus
Type Parameters
Name | Description |
---|---|
T | The connection type. |
Methods
View SourceWithConnection(Func<T, CancellationToken, Task>, CancellationToken)
Ensures that the connection is working to before performing the operation.
Declaration
Task WithConnection(Func<T, CancellationToken, Task> operation, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Func<T, CancellationToken, Task> | operation | The operation to run. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |
WithConnection(Func<T, Task>, CancellationToken)
Ensures that the connection is working to before performing the operation.
Declaration
Task WithConnection(Func<T, Task> operation, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task> | operation | The operation to run. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task | A task for the asynchronous operation. |
WithConnection<TResult>(Func<T, CancellationToken, Task<TResult>>, CancellationToken)
Ensures that the connection is working to before performing the operation.
Declaration
Task<TResult> WithConnection<TResult>(Func<T, CancellationToken, Task<TResult>> operation, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Func<T, CancellationToken, Task<TResult>> | operation | The operation to run. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task<TResult> | A task for the asynchronous operation. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value. |
WithConnection<TResult>(Func<T, Task<TResult>>, CancellationToken)
Ensures that the connection is working to before performing the operation.
Declaration
Task<TResult> WithConnection<TResult>(Func<T, Task<TResult>> operation, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Func<T, Task<TResult>> | operation | The operation to run. |
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task<TResult> | A task for the asynchronous operation. |
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value. |