FANOUT stage v1.0

Pipelines v1.9

 

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

Home

 

Syntax

 

             _STOP_ALLeof______
>>__FANOUT__|__________________|_______________________________________________________><
            |_STOP_ _ALLeof__ _|
                   |_ANYeof__|
                   |_streams_|

 

Purpose

 

Use the FANOUT stage to make a copy of its input stream on every connected output stream. FANOUT reads records from its primary input stream and writes them to multiple output streams in the order: stream 0, stream 1, stream 2 and so on. FANOUT reads one record at a time from its primary input stream and writes the record to each of its connected output streams.

 

Operands

 

    

STOP

specifies how many output streams must be at end-of-file (disconnected), for FANOUT to stop writing records. STOP ALLEOF is the default.

 

 

ALLeof

specifies that records will stop being written when FANOUT determines that no output stream is connected. Records continue to be written as long as at least one output stream is connected. STOP ALLEOF is the default.

 

ANYeof

specifies that records will stop being written as soon as FANOUT determines that any one of its output streams is no longer connected.

 

streams

is an unsigned integer which defines the number of streams that were originally connected, but are now unconnected causing FANOUT to stop writing records. Specifying 1 is equivalent to specifying ANYEOF.

 

Streams used

 

The following streams are used by the FANOUT stage:

 

Stream

Action

 

 

Primary input stream

FANOUT reads records from its primary input stream.

Output streams

FANOUT writes its input records to all of its connected output streams, starting with the primary output stream and continuing with the rest of the streams in order of increasing stream number.

 

Usage notes

 

     1)

FANOUT does not delay the records.

 

     2)

FANOUT determines the number of streams that are at end-of-file each time it attempts to write to an output stream. When this number is reached; FANOUT ends without writing to the remaining connected output streams.

 

     3)

FANOUT verifies that its secondary input stream is not connected and then begins execution.

 

Examples

 

The following pipeline makes two copies of its input record and writes them to separate output files.

 
pipe (endchar ?)
     literal /First output file/
     | a: fanout
     | > output1.txt
     ?
     a:
     | change /First/ /Second/
     | > output2.txt
 

See also

 

Reference the following links for additional information:

 

FANIN, FANINANY