Show / Hide Table of Contents

Class IAsyncResultExtensions

Extension methods for IAsyncResult.

Inheritance
Object
IAsyncResultExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: UnityFx.Async.Extensions
Assembly: UnityFx.Async-netstandard2.0.dll
Syntax
public static class IAsyncResultExtensions

Methods

| Improve this Doc View Source

SpinUntilCompleted(IAsyncResult)

Spins until the operation has completed.

Declaration
public static void SpinUntilCompleted(this IAsyncResult op)
Parameters
Type Name Description
IAsyncResult op

The operation to wait for.

| Improve this Doc View Source

SpinUntilCompleted(IAsyncResult, Int32)

Spins until the operation has completed within a specified timeout.

Declaration
public static bool SpinUntilCompleted(this IAsyncResult op, int millisecondsTimeout)
Parameters
Type Name Description
IAsyncResult op

The operation to wait for.

Int32 millisecondsTimeout

The number of milliseconds to wait, or Infinite (-1) to wait indefinitely.

Returns
Type Description
Boolean

Returns true if the operation was completed within the specified time interfval; false otherwise.

Exceptions
Type Condition
ArgumentOutOfRangeException

millisecondsTimeout is a negative number other than -1.

| Improve this Doc View Source

SpinUntilCompleted(IAsyncResult, Int32, CancellationToken)

Spins until the operation has completed within a specified timeout or until canceled.

Declaration
public static bool SpinUntilCompleted(this IAsyncResult op, int millisecondsTimeout, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncResult op

The operation to wait for.

Int32 millisecondsTimeout

The number of milliseconds to wait, or Infinite (-1) to wait indefinitely.

CancellationToken cancellationToken

A cancellation token that can be used to cancel wait operation.

Returns
Type Description
Boolean

Returns true if the operation was completed within the specified time interfval; false otherwise.

Exceptions
Type Condition
ArgumentOutOfRangeException

millisecondsTimeout is a negative number other than -1.

OperationCanceledException

The cancellationToken was canceled.

| Improve this Doc View Source

SpinUntilCompleted(IAsyncResult, CancellationToken)

Spins until the operation has completed or until canceled.

Declaration
public static void SpinUntilCompleted(this IAsyncResult op, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncResult op

The operation to wait for.

CancellationToken cancellationToken

A cancellation token that can be used to cancel wait operation.

Exceptions
Type Condition
OperationCanceledException

The cancellationToken was canceled.

See Also
SpinUntilCompleted(IAsyncResult)
| Improve this Doc View Source

SpinUntilCompleted(IAsyncResult, TimeSpan)

Spins until the operation has completed within a specified timeout.

Declaration
public static bool SpinUntilCompleted(this IAsyncResult op, TimeSpan timeout)
Parameters
Type Name Description
IAsyncResult op

The operation to wait for.

TimeSpan timeout

A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.

Returns
Type Description
Boolean

Returns true if the operation was completed within the specified time interfval; false otherwise.

Exceptions
Type Condition
ArgumentOutOfRangeException

timeout is a negative number other than -1 milliseconds, or timeout is greater than MaxValue.

| Improve this Doc View Source

SpinUntilCompleted(IAsyncResult, TimeSpan, CancellationToken)

Spins until the operation has completed within a specified timeout or until canceled.

Declaration
public static bool SpinUntilCompleted(this IAsyncResult op, TimeSpan timeout, CancellationToken cancellationToken)
Parameters
Type Name Description
IAsyncResult op

The operation to wait for.

TimeSpan timeout

A TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.

CancellationToken cancellationToken

A cancellation token that can be used to cancel wait operation.

Returns
Type Description
Boolean

Returns true if the operation was completed within the specified time interfval; false otherwise.

Exceptions
Type Condition
ArgumentOutOfRangeException

timeout is a negative number other than -1 milliseconds, or timeout is greater than MaxValue.

OperationCanceledException

The cancellationToken was canceled.

| Improve this Doc View Source

ToEnum(IAsyncResult)

Creates an IEnumerator that completes when the specified operation completes.

Declaration
public static IEnumerator ToEnum(this IAsyncResult op)
Parameters
Type Name Description
IAsyncResult op

The operation to convert to enumerator.

Returns
Type Description
IEnumerator

An enumerator that represents the operation.

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