Interface IAsyncCompletionSource<TResult>
Represents the producer side of a IAsyncOperation<TResult> unbound to a delegate, providing access to the consumer side through the Operation property.
Namespace: UnityFx.Async
Assembly: UnityFx.Async-netstandard2.0.dll
Syntax
public interface IAsyncCompletionSource<TResult>
Type Parameters
Name | Description |
---|---|
TResult | Type of the operation result value. |
Properties
| Improve this Doc View SourceOperation
Gets the operation being controller by the source.
Declaration
IAsyncOperation<TResult> Operation { get; }
Property Value
Type | Description |
---|---|
IAsyncOperation<TResult> | The underlying operation instance. |
Methods
| Improve this Doc View SourceTrySetCanceled()
Attempts to transition the underlying IAsyncOperation<TResult> into the Canceled state.
Declaration
bool TrySetCanceled()
Returns
Type | Description |
---|---|
Boolean | Returns true if the attemp was successfull; false otherwise. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Thrown is the operation is disposed. |
See Also
| Improve this Doc View SourceTrySetException(Exception)
Attempts to transition the underlying IAsyncOperation<TResult> into the Faulted state.
Declaration
bool TrySetException(Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Exception | exception | An exception that caused the operation to end prematurely. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the attemp was successfull; false otherwise. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ObjectDisposedException | Thrown is the operation is disposed. |
See Also
| Improve this Doc View SourceTrySetProgress(Single)
Attempts to set the operation progress value in range [0, 1].
Declaration
bool TrySetProgress(float progress)
Parameters
Type | Name | Description |
---|---|---|
Single | progress | The operation progress in range [0, 1]. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the attemp was successfull; false otherwise. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
ObjectDisposedException | Thrown is the operation is disposed. |
See Also
| Improve this Doc View SourceTrySetResult(TResult)
Attempts to transition the underlying IAsyncOperation<TResult> into the RanToCompletion state.
Declaration
bool TrySetResult(TResult result)
Parameters
Type | Name | Description |
---|---|---|
TResult | result | The operation result. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the attemp was successfull; false otherwise. |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Thrown is the operation is disposed. |