FANINANY stage v1.1

Pipelines v2.1

 

Purpose, Operands, Streams, Usage, Examples, Related

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

 

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

 

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

 

1.

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.

 
   **** Top of file ****
 1 Address Rxpipe
 2
 3 'pipe (endchar ?)',
 4    '< in.txt',
 5    '| a: locate /begin/',
 6    '| f: faninany',
 7    '| console',
 8    '?',
 9    'a:',
10    '| locate /end/',
11    '| f:'
12
13 Exit 0
   **** End of file ****

 

2.

Inserting words

3.

Adding a header record

4.

5.

 

Related

 

ELASTIC, FANIN, FANOUT

 

History

 

Version

 

Date

Action

Description

Pipelines

1.1

24.12.2021

changed

Application-wide rewrite

2.1

1.0

06.09.2007

created

First version.

1.0