Class AsyncUrlRedirectAwaiter
Implements
Inherited Members
Namespace: Unity.Cloud.AppLinking
Assembly: Unity.Cloud.AppLinking.dll
Syntax
public class AsyncUrlRedirectAwaiter : IUrlRedirectAwaiter
Constructors
AsyncUrlRedirectAwaiter(int, int)
Creates an instance of AsyncUrlRedirectAwaiter.
Declaration
public AsyncUrlRedirectAwaiter(int refreshDelay = 500, int timeoutDelay = 600000)
Parameters
Type | Name | Description |
---|---|---|
int | refreshDelay | The delay in milliseconds between checking for a UrlRedirectResult. |
int | timeoutDelay | The max amount of time in milliseconds to wait for redirect before a timeout. |
AsyncUrlRedirectAwaiter(ITimeAwaiter, int, int)
Creates an instance of AsyncUrlRedirectAwaiter.
Declaration
public AsyncUrlRedirectAwaiter(ITimeAwaiter awaiter, int refreshDelay = 500, int timeoutDelay = 600000)
Parameters
Type | Name | Description |
---|---|---|
ITimeAwaiter | awaiter | An implementation of ITimeAwaiter for awaiting a specific amount of time. |
int | refreshDelay | The delay in milliseconds between checking for a UrlRedirectResult. |
int | timeoutDelay | The max amount of time in milliseconds to wait for redirect before a timeout. |
Properties
HasResult
Whether expected result has been received.
Declaration
public bool HasResult { get; }
Property Value
Type | Description |
---|---|
bool |
HasTimedOut
Whether the total wait time has exceeded the TimeoutDelay.
Declaration
public bool HasTimedOut { get; }
Property Value
Type | Description |
---|---|
bool |
RedirectResult
The awaited UrlRedirectResult.
Declaration
public UrlRedirectResult? RedirectResult { get; }
Property Value
Type | Description |
---|---|
UrlRedirectResult? |
RefreshDelay
The delay in milliseconds between checking for a UrlRedirectResult.
Declaration
public int RefreshDelay { get; set; }
Property Value
Type | Description |
---|---|
int |
TimeoutDelay
The max amount of time in milliseconds to wait for redirect before a timeout.
Declaration
public int TimeoutDelay { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
BeginWait()
Initializes the wait period and clears any pre-existing results.
Declaration
public void BeginWait()
SetResult(UrlRedirectResult?)
Sets the awaited UrlRedirectResult.
Declaration
public void SetResult(UrlRedirectResult? result)
Parameters
Type | Name | Description |
---|---|---|
UrlRedirectResult? | result | The result of the redirect operation. |
WaitForRefreshAsync(CancellationToken)
Waits for the specific RefreshDelay period.
Declaration
public Task WaitForRefreshAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token for the operation. |
Returns
Type | Description |
---|---|
Task | A Task that completes when the UrlRedirectResult has been received or the timeout period has elapsed. |
Exceptions
Type | Condition |
---|---|
TaskCanceledException | Thrown if the task is cancelled |