WorkItemHandler WorkItemHandler WorkItemHandler WorkItemHandler Delegate

Definition

Represents a method that is called when a work item runs.

public : delegate void WorkItemHandler(IAsyncAction operation)
public delegate void WorkItemHandler(IAsyncAction operation)
Public Delegate WorkItemHandler(operation As IAsyncAction)
var workItemHandler = function(operation) {

 /* Your code */

}
Parameters
operation
IAsyncAction IAsyncAction IAsyncAction IAsyncAction

The work item to associate with the callback method.

Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The thread pool calls a work item's WorkItemHandler delegate when a thread becomes available to run the work item. If a work item is canceled, WorkItemHandler delegates that have not yet started running are not called. WorkItemHandler delegates that are already running are allowed to finish unless the application stops them. If a work item might run for a relatively long time, the application should check if cancellation has been requested and stop the handler in an orderly way.