Configuration.replaceStreamStart()
Description
Appends a replaceStreamStart filter to the current pipeline layout.
A replaceStreamStart filter calls back user scripts to get a replacement for the first event in the input stream.
- INPUT - Any types of Events.
- OUTPUT - Any types of Events.
The user function will receive as parameter the first event in the input stream. The event will be removed from the stream. Whatever the function returns will be inserted into the output stream in place of the removed event. It can be an event or a Message, or an array of events or Messages. If the function returns nothing (null or undefined), no events will be inserted back into the stream.
You can also use a fixed replacement value instead of a function if the replacement is static.
Syntax
pipy().pipeline().replaceStreamStart(event => transform(event))
Parameters
replaceStreamStart(handler?)
A callback function tha receives the first event passing through the filter and returns its replacement. The replacement can be an Event, a Message or an array of them.
The same Configuration object.