WorkItemHandlerTItem Delegate TIBCO Spotfire 7.12 API Reference
Delegate for handling processed work items. The handler must call ReturnItem when it is finished with the work item.

Namespace: Spotfire.Dxp.Framework.Threading
Assembly: Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 30.0.11525.4184 (30.0.11525.4184)
Syntax

C#
public delegate void WorkItemHandler<TItem>(
	TItem workItem
)
where TItem : WorkItem

Parameters

workItem
Type: TItem
Processed work item.

Type Parameters

TItem
Work item type.
Examples

The following example shows how ReturnItem can be used to synchronize with the application thread.
C#
WorkItemHandler<WorkItem> workItemHandler = 
    delegate(WorkItem workItem)
    {
        AnalysisServices.GetService<ApplicationThread>().InvokeAsynchronously(delegate()
        {
            try
            {
                if (workItem.IsResultValid && !workItem.IsCanceled)
                {
                    // do something to the document.
                }
            }
            finally
            {
                // Tell threading framework that your work item handler is done.
                workItem.ReturnItem();
            }

        });
     };
Version Information

Supported in: 7.9, 7.8, 7.7, 7.6, 7.5, 7.12, 7.11, 7.10, 7.0
See Also

Reference