ItemProcessingEventData Class

Event data common for begin/progress/end processing events. This is a stateful class where it is intended that every node has a single instance of a subclass implementing GraphMessageTotalSize in a suitable way. Implementation note: This data cannot be part of GraphMessage because a single message can be queued at and processed by multiple nodes.

Definition

Namespace: Quine.Graph
Assembly: Quine.Graph (in Quine.Graph.dll) Version: 1.0.0+0ea0706914ee4edf2b0ed66bec3ab4d062a43b68
C#
public class ItemProcessingEventData
Inheritance
Object    ItemProcessingEventData

Constructors

ItemProcessingEventDataInitializes a new instance of the ItemProcessingEventData class

Properties

Exception 
GraphMessage 
GraphMessageTotalSize Returns the total absolute "size" of GraphMessage for progress computation. If the value is 0 or negative, tracking of progress based on processed size is unavailable, but the progress can still be explicitly set by SetItemProgress(Single). NB! This property is virtually invoked from ctor and the implementation may inspect only
MessageProcessingState 
Progress 
Trace Only snapshot is observable during processing. The whole trace is available only after processing end is signaled.

Methods

IncrementProcessedSize Increments absolute processed size by s, ensuring monotonicity of Progress. The operation is atomic, i.e., may be called by multiple threads without additional synchronization. This method can be called only when GraphMessageTotalSize is positive.
SetItemProgress Sets Progress to progress. This method can be always called. This method also triggers event publishing. Additional instance data in derived classes must be set before invoking this method.
SetProcessedSize Sets absolute processed size to s, ensuring monotonicity of Progress. This method can be called only when GraphMessageTotalSize is positive.
SetShouldPublish Should be invoked by the derived class when additional data is ready for publishing.
SetState 

Fields

ProgressReportingPeriod To avoid message flooding, progress events are sent not more frequently than this period (unless forced).

See Also