RSX Code Reference
    Preparing search index...

    Class AsyncOp<T, E>

    Type you may use to check on the results of an asynchronous operation. Contains uninitialized data until AsyncOp#isComplete returns true.

    AsyncOp works like a regular Promise and allows async functions to await the result.

    Type Parameters

    • T

      Type of the return value. Caller must ensure to provide the valid type.

    • E = void

    Hierarchy (View Summary)

    Implements

    • Promise<T>
    Index
    • Type Parameters

      • T

        Type of the return value. Caller must ensure to provide the valid type.

      • E = void

      Returns AsyncOp<T, E>

    "[toStringTag]": string
    • get error(): E

      Retrieves the error returned by the async operation. Only valid if AsyncOpBase.isError returns true.

      Returns E

      Return error of the async operation.

    • get identifier(): object

      An opaque identifier that uniquely identifies this AsyncOp on the system. The returned is not specified, but guaranteed to be the same during runtime.

      Returns object

    • get isComplete(): boolean

      Returns true if the async operation has completed.

      Returns boolean

    • get isFailed(): boolean

      Returns true if the async operation has failed.

      Returns boolean

    • get isPending(): boolean

      Returns true if the async operation is pending completion or failure.

      Returns boolean

    • get value(): T

      Retrieves the value returned by the async operation. Only valid if AsyncOpBase.isComplete returns true.

      Returns T

      Return value of the async operation.

    • Blocks the caller thread until the AsyncOp completes or fails.

      Returns AsyncOp<T, E>

    • Attaches a Promise-compatible rejection handler to the async op.

      Type Parameters

      • TResult = never

      Parameters

      • OptionalonRejected: (reason: any) => TResult | PromiseLike<TResult>

        The callback invoked when the async op fails.

      Returns Promise<T | TResult>

      A native Promise for the rejection handler result or the original successful result.

    • Attaches a failure handler to the async op.

      Parameters

      • onError: (error: E) => void

        The callback to be called as continuation.

      Returns this

      this

    • Attaches a finalization handler to the async op.

      Parameters

      • OptionalonFinally: () => void

        The callback to be called in case of success or failure.

      Returns Promise<T>

      A native Promise that settles with the original result after the handler runs.

    • Determines if this async op matches the specified identifier.

      Parameters

      • identifier: object

      Returns boolean

    • Attaches Promise-compatible completion and rejection handlers to the async op.

      Type Parameters

      • TResult1 = T
      • TResult2 = never

      Parameters

      Returns Promise<TResult1 | TResult2>

      A native Promise for the handler result.

    • Attaches a legacy combined completion handler to the async op.

      Type Parameters

      • TResult = void

      Parameters

      • onComplete: (result: T, error?: E, identifier?: object) => TResult | PromiseLike<TResult>

      Returns Promise<TResult>

      Use the Promise-compatible fulfillment and rejection handlers instead.