Task<TResult>.WaitAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
WaitAsync(TimeSpan, TimeProvider) |
Gets a Task<TResult> that will complete when this Task<TResult> completes or when the specified timeout expires. |
WaitAsync(CancellationToken) |
Gets a Task<TResult> that will complete when this Task<TResult> completes or when the specified CancellationToken has cancellation requested. |
WaitAsync(TimeSpan) |
Gets a Task<TResult> that will complete when this Task<TResult> completes or when the specified timeout expires. |
WaitAsync(TimeSpan, CancellationToken) |
Gets a Task<TResult> that will complete when this Task<TResult> completes, when the specified timeout expires, or when the specified CancellationToken has cancellation requested. |
WaitAsync(TimeSpan, TimeProvider, CancellationToken) |
Gets a Task<TResult> that will complete when this Task<TResult> completes, when the specified timeout expires, or when the specified CancellationToken has cancellation requested. |
WaitAsync(TimeSpan, TimeProvider)
- Source:
- Future.cs
- Source:
- Future.cs
Gets a Task<TResult> that will complete when this Task<TResult> completes or when the specified timeout expires.
public:
System::Threading::Tasks::Task<TResult> ^ WaitAsync(TimeSpan timeout, TimeProvider ^ timeProvider);
public System.Threading.Tasks.Task<TResult> WaitAsync (TimeSpan timeout, TimeProvider timeProvider);
override this.WaitAsync : TimeSpan * TimeProvider -> System.Threading.Tasks.Task<'Result>
Public Function WaitAsync (timeout As TimeSpan, timeProvider As TimeProvider) As Task(Of TResult)
Parameters
- timeout
- TimeSpan
The timeout after which the Task should be faulted with a TimeoutException if it hasn't otherwise completed.
- timeProvider
- TimeProvider
The TimeProvider with which to interpret timeout
.
Returns
The Task<TResult> representing the asynchronous wait. It may or may not be the same instance as the current instance.
Applies to
WaitAsync(CancellationToken)
- Source:
- Future.cs
- Source:
- Future.cs
- Source:
- Future.cs
Gets a Task<TResult> that will complete when this Task<TResult> completes or when the specified CancellationToken has cancellation requested.
public:
System::Threading::Tasks::Task<TResult> ^ WaitAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> WaitAsync (System.Threading.CancellationToken cancellationToken);
override this.WaitAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Public Function WaitAsync (cancellationToken As CancellationToken) As Task(Of TResult)
Parameters
- cancellationToken
- CancellationToken
The CancellationToken to monitor for a cancellation request.
Returns
The Task<TResult> representing the asynchronous wait. It may or may not be the same instance as the current instance.
Applies to
WaitAsync(TimeSpan)
- Source:
- Future.cs
- Source:
- Future.cs
- Source:
- Future.cs
Gets a Task<TResult> that will complete when this Task<TResult> completes or when the specified timeout expires.
public:
System::Threading::Tasks::Task<TResult> ^ WaitAsync(TimeSpan timeout);
public System.Threading.Tasks.Task<TResult> WaitAsync (TimeSpan timeout);
override this.WaitAsync : TimeSpan -> System.Threading.Tasks.Task<'Result>
Public Function WaitAsync (timeout As TimeSpan) As Task(Of TResult)
Parameters
- timeout
- TimeSpan
The timeout after which the Task should be faulted with a TimeoutException if it hasn't otherwise completed.
Returns
The Task<TResult> representing the asynchronous wait. It may or may not be the same instance as the current instance.
Applies to
WaitAsync(TimeSpan, CancellationToken)
- Source:
- Future.cs
- Source:
- Future.cs
- Source:
- Future.cs
Gets a Task<TResult> that will complete when this Task<TResult> completes, when the specified timeout expires, or when the specified CancellationToken has cancellation requested.
public:
System::Threading::Tasks::Task<TResult> ^ WaitAsync(TimeSpan timeout, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> WaitAsync (TimeSpan timeout, System.Threading.CancellationToken cancellationToken);
override this.WaitAsync : TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Public Function WaitAsync (timeout As TimeSpan, cancellationToken As CancellationToken) As Task(Of TResult)
Parameters
- timeout
- TimeSpan
The timeout after which the Task should be faulted with a TimeoutException if it hasn't otherwise completed.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for a cancellation request.
Returns
The Task<TResult> representing the asynchronous wait. It may or may not be the same instance as the current instance.
Applies to
WaitAsync(TimeSpan, TimeProvider, CancellationToken)
- Source:
- Future.cs
- Source:
- Future.cs
Gets a Task<TResult> that will complete when this Task<TResult> completes, when the specified timeout expires, or when the specified CancellationToken has cancellation requested.
public:
System::Threading::Tasks::Task<TResult> ^ WaitAsync(TimeSpan timeout, TimeProvider ^ timeProvider, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<TResult> WaitAsync (TimeSpan timeout, TimeProvider timeProvider, System.Threading.CancellationToken cancellationToken);
override this.WaitAsync : TimeSpan * TimeProvider * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Public Function WaitAsync (timeout As TimeSpan, timeProvider As TimeProvider, cancellationToken As CancellationToken) As Task(Of TResult)
Parameters
- timeout
- TimeSpan
The timeout after which the Task should be faulted with a TimeoutException if it hasn't otherwise completed.
- timeProvider
- TimeProvider
The TimeProvider with which to interpret timeout
.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for a cancellation request.
Returns
The Task<TResult> representing the asynchronous wait. It may or may not be the same instance as the current instance.