Event pipeline
Creation of a single execution path with multiple nodes
Last updated
Was this helpful?
Creation of a single execution path with multiple nodes
Last updated
Was this helpful?
The goal is to join a set of nodes together to form an execution graph that processes an event in predictable order. The execution graph has a single path a pipline node is invoked after a parent node has processed an event.
The annotation marks a method to be included in the execution graph. The method will be invoked when all of its dependent nodes on the execution path have processed the event. Event processing includes @OnEvent and @EventHandler annotated methods of parents.
A valid OnEvent method has no arguments with an optional boolean return type. The boolean return indicates whether this node is "dirty" and event notification should continue, change notifications are .
This example defines a PipelineNode
that is dependent upon a DataEventHandler
. The DataEventHandler processes DataEvent's as an event handler.
The pipeline example code is located .
The update method will be invoked by the SEP in topological order after the DataHandler has processed an incoming event. We define the graph imperatively using a builder class, further discussion on builders is in the section.
The PipelineNode class declares a dependency to its parent, DataEventHandler (handler). The annotation requires this method to be invoked after handler has complete processing the incoming event. See for discussion on node ordering.
A pipeline is defined with two nodes, the PipelineNode is a child of the DataEventHandler node.
The generated SEP, implements a dispatch method invoking the execution path in topological order. As expected dataEventHandler_1 processes the event before pipelineNode_3 is notified of the event wave.
The graphical representation of this execution graph as generated by Fluxtion ESC:
Any method marked with @OnEvent should be a no arg method, with an optional boolean return. The boolean return value indicates if this node has updated after processing the notification.
As described in , the elements in the image are consistent with the generated code. For example the variable name of the PipelineNode is pipelineNode_3 in both the image and the generated SEP.
An execution is path is formed by the ESC, the nodes are methods on that path. We mark a method for inclusion in the graph using the annotation. Any OnEvent method will be invoked when all of its dependent nodes on the execution path have executed their respective event handling methods. Event handling methods include both @OnEvent and @EventHandler methods.