Interface IAsyncOperation<TResult>
Represents the consumer side of an asynchronous operation (promise). Extends IAsyncOperation interface with a result value.
Inherited Members
System.IDisposable.Dispose()
System.IObservable<TResult>.Subscribe(System.IObserver<TResult>)
Namespace: UnityFx.Async
Assembly: UnityFx.Async-netstandard2.0.dll
Syntax
public interface IAsyncOperation<out TResult> : IAsyncOperation, IAsyncOperationCallbacks, IAsyncCancellable, IAsyncResult, IDisposable, IObservable<TResult>
Type Parameters
Name | Description |
---|---|
TResult | Type of the operation result value. |
Properties
| Improve this Doc View SourceResult
Gets the operation result value.
Declaration
TResult Result { get; }
Property Value
Type | Description |
---|---|
TResult | Result of the operation. |
Remarks
Once the result of an operation is available, it is stored and is returned immediately on subsequent calls to the Result property. Unlike Tasks accessing the property does not block the calling thread (InvalidOperationException is throws instead). Note that, if an exception occurred during the operation, or if the operation has been cancelled, the Result property does not return a value. Instead, attempting to access the property value throws an exception.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if the property is accessed before operation is completed. |