Sleep

Not available in Community Designer

Short Description
Ports
Metadata
Sleep Attributes
Best practices
See also

Short Description

Sleep slows down data records going through it.

Component Same input metadata Sorted inputs Inputs Outputs Each to all outputs Java CTL Auto-propagated metadata
Sleep-
no
0-11-n
yes
no
no
yes

Abstract

Sleep receives data records through its single input port, delays each input record by a specified number of milliseconds and copies each input record to all connected output ports. Total delay does not depend on the number of output ports. It only depends on the number of input records.

The delay can be specified statically by Delay attribute or dynamically based on incoming record content in Input mapping attribute.

Icon

Ports

Port typeNumberRequiredDescriptionMetadata
Input0
yes
For input data recordsAny
Output0
yes
For copied data recordsInput 0
1-n
no
For copied data recordsInput 0

Metadata

All metadata must be the same.

Metadata can be propagated through this component.

Sleep Attributes

AttributeReqDescriptionPossible values
Basic
Delay [1] Delay of processing each input record; by default in milliseconds, but other time units may be used. Total delay of parsing is equal to the this value multiplicated by the number of input records.0-N or time units
Input mapping [1] Delay for input records processing can be also defined dynamically. You can determine how long should be record delayed based on incoming record content. So delay can be dynamically changed by your CTL code. Possible outputs of the mapping are two different values - string value delay, which can be populated by same value as component's attribute Delay, for example '15s'. Second output value delayMillis can specify delay by number of milliseconds. CTL code

[1] One of these must be specified.

Best practices

When using Sleep, do not forget records are sent out from the component only after its buffer gets full (by default). Sometimes you might need to:

  1. send a record to Sleep

  2. have it delayed by a specified number of seconds

  3. send this very record to output ports immediately

In such case, you have to change settings of the edge outgoing from Sleep to Direct fast propagate. See Types of Edges for more details.

[Tip]Tip

An unconnected Sleep component can be used to insert a pause between different phases of a graph. Put an extra phase between the two phases with single unconnected Sleep component.

See also

Common Properties of Components
Specific Attribute Types
Others Comparison