TimeoutAfter
(
task
, ms
)
|
Causes a task to timeout after a given amount of time in ms. The task's result will be an error message
Signature
static async Task<bool> Meta.WitAi.TaskExtensions.TimeoutAfter(this Task task, int ms) Parameters task: this TaskÂ
The task to wait for
ms: intÂ
The amount of time to wait
Returns async Task< bool >Â
Returns true if this task ran to completion without timing out
Throws AggregateException |
WhenLessThan
(
tasks
, max
)
|
A task that completes when less than the specified max tasks are running
Signature
static Task Meta.WitAi.TaskExtensions.WhenLessThan(this ICollection< Task > tasks, int max) Parameters tasks: this ICollection< Task >max: intReturns Task |
WhenLessThan
(
tasks
, max
, cancellationToken
)
|
A task that completes when less than the specified max tasks are running
Signature
static Task Meta.WitAi.TaskExtensions.WhenLessThan(this ICollection< Task > tasks, int max, CancellationToken cancellationToken) Parameters tasks: this ICollection< Task >max: intcancellationToken: CancellationTokenReturns Task |
WrapErrors
(
task
)
|
Signature
static void Meta.WitAi.TaskExtensions.WrapErrors(this Task task) Parameters task: this TaskReturns void |