Interface IAsyncCompletionSource
Represents the producer side of an asynchronous operation 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
Properties
| Improve this Doc View SourceOperation
Gets the operation being controller by the source.
Declaration
IAsyncOperation Operation { get; }
Property Value
Type | Description |
---|---|
IAsyncOperation | The underlying operation instance. |
Methods
| Improve this Doc View SourceTrySetCanceled()
Attempts to transition the underlying IAsyncOperation 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 SourceTrySetCompleted()
Attempts to transition the underlying IAsyncOperation into the RanToCompletion state.
Declaration
bool TrySetCompleted()
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 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. |