Show / Hide Table of Contents

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 Source

Operation

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 Source

TrySetCanceled()

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
TrySetException(Exception)
TrySetCompleted()
| Improve this Doc View Source

TrySetCompleted()

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
TrySetCanceled()
TrySetException(Exception)
TrySetProgress(Single)
| Improve this Doc View Source

TrySetException(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 exception is null.

ObjectDisposedException

Thrown is the operation is disposed.

See Also
TrySetCanceled()
TrySetCompleted()
| Improve this Doc View Source

TrySetProgress(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 progress is not in range [0, 1].

ObjectDisposedException

Thrown is the operation is disposed.

See Also
TrySetCompleted()

Extension Methods

AsyncExtensions.SetProgress(IAsyncCompletionSource, Single)
AsyncExtensions.SetCanceled(IAsyncCompletionSource)
AsyncExtensions.TrySetException(IAsyncCompletionSource, String)
AsyncExtensions.SetException(IAsyncCompletionSource, String)
AsyncExtensions.SetException(IAsyncCompletionSource, Exception)
AsyncExtensions.SetCompleted(IAsyncCompletionSource)

See Also

IAsyncOperation
  • Improve this Doc
  • View Source
Back to top Copyright (c) 2017-2018 Alexander Bogarsukov