TaskStateMonitor.WhenAllAsync Method (IEnumerable<CloudTask>, TaskState, TimeSpan, ODATAMonitorControl, IEnumerable<BatchClientBehavior>)
Begins asynchronous call to monitor an CloudTask collection until each of its members has reached a desired state at least once. The State of each CloudTask instance is assumed to authoritative at the time of the call. Instances that are already at the desiredState are ignored. The CloudTask instances in the collection are treated as read-only. No updates are made to any of these instances. This means that when the call completes (timeout or not) the CloudTask instances should be refreshed before using.
Namespace: Microsoft.Azure.Batch
Assembly: Microsoft.Azure.Batch (in Microsoft.Azure.Batch.dll)
Syntax
public Task<bool> WhenAllAsync(
IEnumerable<CloudTask> tasksToMonitor,
TaskState desiredState,
TimeSpan timeout,
ODATAMonitorControl controlParams = null,
IEnumerable<BatchClientBehavior> additionalBehaviors = null
)
public:
Task<bool>^ WhenAllAsync(
IEnumerable<CloudTask^>^ tasksToMonitor,
TaskState desiredState,
TimeSpan timeout,
ODATAMonitorControl^ controlParams = null,
IEnumerable<BatchClientBehavior^>^ additionalBehaviors = null
)
member WhenAllAsync :
tasksToMonitor:IEnumerable<CloudTask> *
desiredState:TaskState *
timeout:TimeSpan *
controlParams:ODATAMonitorControl = null *
additionalBehaviors:IEnumerable<BatchClientBehavior> = null -> Task<bool>
Public Function WhenAllAsync (
tasksToMonitor As IEnumerable(Of CloudTask),
desiredState As TaskState,
timeout As TimeSpan,
controlParams As ODATAMonitorControl,
additionalBehaviors As IEnumerable(Of BatchClientBehavior)
) As Task(Of Boolean)
Parameters
tasksToMonitor
Type: System.Collections.Generic.IEnumerable<CloudTask>The collection of tasks to monitor.
desiredState
Type: Microsoft.Azure.Batch.Common.TaskStateThe target state of the tasks. The WhenAll will exit when all tasks have reached this state at least once.
timeout
Type: System.TimeSpanThe maximum amount of time this call will wait before timing out.
controlParams
Type: Microsoft.Azure.Batch.ODATAMonitorControlControls various settings of the monitor, such as delay between each poll.
additionalBehaviors
Type: System.Collections.Generic.IEnumerable<BatchClientBehavior>A collection of BatchClientBehavior instances that are applied after the CustomBehaviors on the current object.
Return Value
Type: System.Threading.Tasks.Task<Boolean>
True if the WhenAll timed out, false if it did not.
See Also
WhenAllAsync Overload
TaskStateMonitor Class
Microsoft.Azure.Batch Namespace
Return to top