FANINANY stage v1.0

Pipelines v1.9

 

Purpose, Operands, Streams used, Usage notes, Examples, See also

Home

 

Syntax

 

>>__FANINANY___________________________________________________________________________><

 

Purpose

 

Use the FANINANY stage to combine multiple input streams into a single output stream. FANINANY reads any available input record, regardless of the input stream it is on and copies the records to its primary output stream. Records from a particular input stream appear in the output stream in the order in which FANINANY reads them from that input stream, but they may be interspersed with records from other input streams. When FANINANY reads multiple input streams, the relative order of the records read from any two input streams is unpredictable unless both of the following are true:

 

     1)

The input streams originate in FANOUT or in a common stage that has the following characteristics:

 

 

The stage reads from its primary input stream and writes to its primary or secondary output stream depending on a condition.

When both of the stage’s output streams are connected, an input record is written once to only one stream.

 

     2)

No stages in the multi-stream portion of the pipeline delay the records.

 

Operands

 

None.

 

Streams used

 

The following streams are used by the FANINANY stage:

 

Stream

Action

 

 

Input streams

FANINANY reads any available input record from any connected input stream.

Primary output stream

FANINANY copies its input records to its primary output stream in the same order it reads its input records.

 

Usage notes

 

     1)

FANINANY does not delay the records.

 

     2)

If the FANINANY stage discovers that its primary output stream is not connected, the FANINANY stage ends.

 

     3)

You can control the order in which FANINANY writes records by controlling the order in which records arrive at FANINANY. For example, if you want records to pass through a multi-stream portion of a pipeline and exit from FANINANY in the same relative order; specify only stages that do not delay records in the multi-stream portion of the pipeline.

 

     4)

FANINANY does not cause a set of pipelines to stall in situations where FANIN would cause a stall.

 

     5)

FANINANY verifies that its secondary output stream is not connected and then begins execution.

 

Examples

 

The following pipeline reads the file: in.txt and displays on the console only the records that contain the word begin or the word end.

 
pipe (endchar ?)
     < in.txt
     | a: locate /begin/
     | f: faninany
     | console
     ?
     a:
     | locate /end/
     | f:
 

See also

 

Reference the following links for additional information:

 

ELASTIC, FANIN, FANOUT