WorkDispatcherTItem Class

Spotfire 14.3 API Reference
Allows work items to be queued and sent to a worker for processing. A work dispatcher is created by the work manager service.
Inheritance Hierarchy

SystemObject
  Spotfire.Dxp.Framework.ThreadingWorkDispatcher
    Spotfire.Dxp.Framework.ThreadingWorkDispatcherTItem

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

C#
public sealed class WorkDispatcher<TItem> : WorkDispatcher
where TItem : WorkItem

Type Parameters

TItem
WorkItem type.

The WorkDispatcherTItem type exposes the following members.

Properties

  NameDescription
Public propertyAutoCancel
Gets or sets a value indicating whether worker model changes should automatically cancel added work items. The default value is true.
(Inherited from WorkDispatcher.)
Public propertyAutoDisposeItems
Gets or sets a value indicating whether work items should be automatically disposed. The default value is true. Manipulating this flag should be avoided whenever possible. Instead use work item handlers to make sure that work items are not disposed too early.
(Inherited from WorkDispatcher.)
Public propertyIsDisposed
Gets a value indicating whether this instance has been disposed.
(Inherited from WorkDispatcher.)
Public propertyMaxQueueSize
Gets or sets the maximum allowed number of items waiting to be dispatched. Before new items are added, items at the back of the queue will be canceled to make room.
(Inherited from WorkDispatcher.)
Top
Methods

  NameDescription
Public methodAddFirst
Adds the item to the front of the queue.
Public methodAddLast
Adds the item to the back of the queue.
Public methodAddWorkerModelChangedHandler
Adds a handler for the worker model changed event. If AutoCancel is true, all currently dispatched work items are canceled before this event is raised. The callee would typically invalidate any stored work results, and dispatch new work items when needed. The event can be raised on any thread.
Public methodCancel(IEnumerableTItem)
Cancel the specified work items.
Public methodCancel(TItem)
Cancel the work item.
Public methodCancelAll
Cancel all work items.
(Inherited from WorkDispatcher.)
Public methodDispose
Cancels all work items and frees up resources.
(Inherited from WorkDispatcher.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecuteSynchronously
Executes the item synchronously. This method is suitable when forced to execute items one by one and access the result synchronously.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetItems
Gets the work items that are currently waiting to be dispatched.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodRemoveWorkerModelChangedHandler
Removes a handler for the worker model changed event.
Public methodSetItems
Sets the items to be dispatched. The first item will be dispatched first.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodWaitAll
Waits until all items have been processed.
Top
Remarks

Before adding items, the MaxQueueSize must be set to an appropriate value.
Version Information

Supported in: 14.3, 14.2, 14.1, 14.0, 12.5, 12.4, 12.3, 12.2, 12.1, 12.0, 11.8
See Also

Reference