Batch processing
Provide batch processing to nodes
Last updated
Provide batch processing to nodes
Last updated
The goal is to provide a batch life-cycle for nodes to integrate with
Nodes may want to process events as part of a larger transaction. For example a set of bank transfer events may make up a single transaction that prints a confirmation on completion. We could tie the confirmation node to a batch life-cycle.
Fluxtion provides two annotations that configure batch processing:
The generated SEP implements the BatchHandler interface. Applications can call the BatchHandler methods and the SEP will handle all dispatch logic to nodes on the execution graph. Batch handlers are invoked in reverse topological order.
Fluxtion event processors can be exceedingly fast, even waiting between network packets. Batch pause permits actions to execute if enough data has been received.
The example shows two nodes that declare batchPause
and batchEnd
methods using the annotations defined. Batch invocations are in reverse topological order.
The code for the example is located here.
As described the node batch methods are invoked in the SEP BatchHandler interface methods. The child node does not declare any batch methods as is not included in batch callbacks.
The png generated by the Fluxtion ESC:
Annotation
Behaviour
Notifies the node more messages are expected but there is a pause in the message flow.
Notifies the node that the batch has completed.