DELAY stage v1.0

 

Pipelines v1.9

 

Purpose, Input record format, Streams used, Usage notes, Examples, See also

Home

 

Syntax

 
>>__ _DELAY__ _________________________________________________________________________><
    |_WAKEUP_| 
 
Input record format:
 
|_ _hh_ ___________________ __________________________________ _ __________ ____________|
  |    | (1)               |                                  | |_argument_|
  |    |____:mm_ ________ _|                                  |
  |             | (1)    |                                    |
  |             |____:ss_|                                    |
  |  _WAIT___                                    (1)          |
  |_|________|_+_ _ ___________________________ ____seconds_ _|
    |_NOWAIT_|   | |               (1)         |            |
                 | |_ ___________ ____minutes:_|            |
                 |   | (1)       |                          |
                 |   |____hours:_|                          |
                 | (1)             (1)                      |
                 |____milliseconds____MS____________________|
 
Notes:
(1) Spaces are not allowed here.
 

Purpose

 

Use the DELAY stage to read a record from its primary input stream, wait for some event to occur, and then copy that record to its primary output stream. DELAY repeats this process for every input record, processing them one at a time. The events for which DELAY waits are time-based. DELAY can be told to wait for a particular time of day or for some time interval to elapse.

 

When an input record specifies an actual time of day to wait for:

 

    

DELAY reads a record from its primary input stream and interprets the first blank delimited word of that record as a time of day to wait for. DELAY uses this definition on a record by record basis to determine the specified time to elapse. Each input record can specify a different specification. Each input record may also specify data after the control definition and this is considered as the stage command argument. Although DELAY looks at only the first blank-delimited word when determining the amount of time to wait; it copies only the input record stage command argument data to its primary output stream.

 

When an input record specifies a time interval to wait to expire:

 

    

DELAY reads a record from its primary input stream and interprets the first (up to three) blank delimited words of that record as a WAIT/NOWAIT operand and an interval definition, respectively. DELAY uses these definitions on a record by record basis to determine whether to process the record immediately or to wait for the specified time to elapse, before writing an output record. Each input record can specify a different specification. Input records may also specify data after the control definitions and this is considered as the stage command argument. Although DELAY looks at only the first three blank-delimited words when determining the amount of time to wait; it copies only the input record stage command argument data to its primary output stream.

 

Input record format

 

    

hh

is an unsigned integer which specifies the number of hours.

 

 

:mm

is an unsigned integer which specifies the number of minutes.

 

:ss

is an unsigned integer which specifies the number of seconds.

 

    

WAIT

specifies that DELAY should read an input record, wait for the time interval to elapse, process that record and then write an output record.

 

    

NOWAIT

specifies that DELAY should read an input record; process that record and write an output record immediately, then wait for the time interval to elapse.

 

    

+

Indicates that the following time or millisecond delay value is relative to the current time.

 

 

hours

is an unsigned integer which specifies the number of hours to wait.

 

minutes:

is an unsigned integer which specifies the number minutes.

 

 

seconds:

is an unsigned integer which specifies the number of seconds.

 

 

milliseconds

is an unsigned integer which specifies the number of milliseconds.

 

 

    

argument

is the data that will be written as an output record.

 

Streams used

 

The following streams are used by the DELAY stage:

 

Stream

Action

 

 

Primary input stream

DELAY reads records from its primary input stream.

Primary output stream

DELAY writes primary input stream records to its primary output stream.

 

Usage notes

 

     1)

Delay does not delay the records.

 

     2)

If the DELAY stage discovers that its primary output stream is not connected; the DELAY stage ends.

 

     3)

The maximum amount of time that the DELAY stage will wait is: 1209600000 milliseconds (approximately 2 weeks). Windows is not a real-time system, it is a multi-user/time-share operating system which must service its load by priority. As such, this maximum value may fluctuate by as much as (best estimate) ~20 milliseconds on a machine even with a light load. The actual start time is dependent on exactly when the stage is dispatched, the length of time needed to parse its stage command argument and the length of time needed to enter its runtime phase, before the clock ‘starts ticking’. If you specify a value which represents a delay value of less than (or there about) 20 milliseconds; you should not rely on accuracy. Although, in saying that, since you cannot anticipate the load on your system, all values must be considered as best case and can never be relied upon, anywhere near close to ‘exact’.

 

     4)

DELAY verifies that its secondary input and output streams are not connected and then begins execution.

 

Examples

 

The following pipeline; pings the address: www.tenfiftytwo.co.uk after every 3 seconds, 5 times. The output generated by the SHELL stage, which executes the command; is displayed on the console and is also written to the output file: ping.log.

 

pipe literal '+3 ping www.tenfiftytwo.co.uk'

     | duplicate 4

     | delay

     | shell

     | console
     | > ping.log

 

See also

 

None.