- Print
- PDF
Sorts all events that passes through this node
Parameters:
none
Inputs
Audio:
none
Events:
All
Outputs
Audio:
none
Events:
All
Remarks
The sorting mechanism employed ensures that events occurring earlier in time are observed in the output before those occurring later.
While the usage of this node may seem straightforward, its implementation involves complexities not immediately apparent. The Data Flow engine monitors all in-progress audio data sample indexes and timestamps of events. When an event reaches this node, it is placed in a waiting queue until there are no in-progress audio or events in the engine that precede this new event. The engine checks this queue each time an event or audio processing is completed.
This node has a notable impact, causing faster-produced events to wait until slower events are ready. From the customer's perspective, this results in responses that are slower but more linear. Observers examining the output of the EventSorter node will consistently see events in the order they occur in real time.
To illustrate, suppose you send speech fragments to both the sr-http and emotion nodes, with 10 speech fragments in total. It is conceivable that when the emotion node finishes analyzing the 9th fragment, the sr-http node has not completed processing the 2nd fragment. This discrepancy arises from the faster processing speed of the emotion service compared to the sr-http service. The goal of EventSorter is to organize these events in a linear time sequence.
Project Structure
The event Sorter node works with all events. Which means any node that outputs events can be used with the event sorter node. In this example, We are making sure the Sentiment events and the Punctuation events are sorted before being published.
Supported flow types: stream, batch