Stay organized with collections
Save and categorize content based on your preferences.
Google.Play.Common.PlayAsyncOperation< TResult, TError >
This is an abstract class.Represents an asynchronous operation that produces a result upon completion.
Summary
Details |
Template Parameters |
TResult
|
The type of the result of the operation.
|
TError
|
The type of error that can be encountered during this operation.
|
|
Inheritance
Inherits from: CustomYieldInstruction
Properties
|
Error
|
TError
The error that prevented this operation from completing successfully.
|
IsDone
|
bool
Whether or not the operation has finished.
|
IsSuccessful
|
abstract bool
Whether or not the operation completed without error.
|
keepWaiting
|
override bool
|
Events
|
Completed = delegate { }
|
Action< PlayAsyncOperation< TResult, TError > >
Event that is invoked upon operation completion.
|
Public functions
|
GetResult()
|
TResult
Gets the result, if the operation is done.
|
Properties
Error
TError Error
The error that prevented this operation from completing successfully.
In the case of a successful operation, this value can be ignored.
IsDone
bool IsDone
Whether or not the operation has finished.
IsSuccessful
abstract bool IsSuccessful
Whether or not the operation completed without error.
keepWaiting
override bool keepWaiting
Events
Completed
Action< PlayAsyncOperation< TResult, TError > > Completed = delegate { }
Event that is invoked upon operation completion.
If an event handler is registered after the operation has completed, and thus after this event has been invoked, then the handler will be called synchronously.
Public functions
GetResult
TResult GetResult()
Gets the result, if the operation is done.
Details |
Exceptions |
InvalidOperationException
|
Throws if GetResult is called before the operation is done, or if an error occured during the operation.
|
|
Protected functions
GetResultImpl
virtual abstract TResult GetResultImpl()
Returns the operation result.
Details |
Returns
|
The result of the operation.
|
InvokeCompletedEvent
void InvokeCompletedEvent()
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-03-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-03-29 UTC."],[],[],null,["# Google.Play.Common.PlayAsyncOperation Class Reference\n\nGoogle.Play.Common.PlayAsyncOperation\\\u003c TResult, TError \\\u003e\n==========================================================\n\n**This is an abstract class.** \n\nRepresents an asynchronous operation that produces a result upon completion.\n\nSummary\n-------\n\n\u003cbr /\u003e\n\n| Details ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Template Parameters | |-----------|------------------------------------------------------------------| | `TResult` | The type of the result of the operation. | | `TError` | The type of error that can be encountered during this operation. | |\n\n### Inheritance\n\nInherits from: CustomYieldInstruction\n\n| ### Properties ||\n|--------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Error](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a5cd822567ca55c213e28a5af785a13c2) | `TError` The error that prevented this operation from completing successfully. |\n| [IsDone](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a157c9bb04489f5d6c767879cbaa4dcec) | `bool` Whether or not the operation has finished. |\n| [IsSuccessful](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1af8601dc325a0b1fc4f4ce8a1388e4b88) | `abstract bool` Whether or not the operation completed without error. |\n| [keepWaiting](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aadacbd7f1e9bec59d24a6a1e92f5b4e4) | `override bool` Implements the [CustomYieldInstruction.keepWaiting](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction-keepWaiting.html) property so that this request can be yielded on in a coroutine. |\n\n| ### Events ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|\n| [Completed](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aa51286b27eae60ca169d3fa0d4030988)` = delegate { }` | `Action\u003c PlayAsyncOperation\u003c TResult, TError \u003e \u003e` Event that is invoked upon operation completion. |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| [GetResult](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a09e7c53341bf01e55ce4cba485105d2e)`()` | `TResult` Gets the result, if the operation is done. |\n\n| ### Protected functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GetResultImpl](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a2b8607686e7676a0df29dd291fdc0456)`()` | `virtual abstract TResult` Returns the operation result. |\n| [InvokeCompletedEvent](#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1a2c5b22257a3e936815e158c625d5e7bb)`()` | `void` Invokes the [Completed](/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aa51286b27eae60ca169d3fa0d4030988) event. |\n\nProperties\n----------\n\n### Error\n\n```c#\nTError Error\n``` \nThe error that prevented this operation from completing successfully.\n\nIn the case of a successful operation, this value can be ignored. \n\n### IsDone\n\n```c#\nbool IsDone\n``` \nWhether or not the operation has finished. \n\n### IsSuccessful\n\n```c#\nabstract bool IsSuccessful\n``` \nWhether or not the operation completed without error. \n\n### keepWaiting\n\n```c#\noverride bool keepWaiting\n``` \nImplements the [CustomYieldInstruction.keepWaiting](https://docs.unity3d.com/ScriptReference/CustomYieldInstruction-keepWaiting.html) property so that this request can be yielded on in a coroutine.\n\nEvents\n------\n\n### Completed\n\n```c#\nAction\u003c PlayAsyncOperation\u003c TResult, TError \u003e \u003e Completed = delegate { }\n``` \nEvent that is invoked upon operation completion.\n\nIf an event handler is registered after the operation has completed, and thus after this event has been invoked, then the handler will be called synchronously.\n\nPublic functions\n----------------\n\n### GetResult\n\n```c#\nTResult GetResult()\n``` \nGets the result, if the operation is done.\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Exceptions | |-----------------------------|----------------------------------------------------------------------------------------------------------| | `InvalidOperationException` | Throws if GetResult is called before the operation is done, or if an error occured during the operation. | |\n\nProtected functions\n-------------------\n\n### GetResultImpl\n\n```c#\nvirtual abstract TResult GetResultImpl()\n``` \nReturns the operation result.\n\n\u003cbr /\u003e\n\n| Details ||\n|-------------|------------------------------|\n| **Returns** | The result of the operation. |\n\n### InvokeCompletedEvent\n\n```c#\nvoid InvokeCompletedEvent()\n``` \nInvokes the [Completed](/reference/unity/class/Google/Play/Common/PlayAsyncOperation-TResult-TError-#classGoogle_1_1Play_1_1Common_1_1PlayAsyncOperation_3_01TResult_00_01TError_01_4_1aa51286b27eae60ca169d3fa0d4030988) event."]]