Delay By One avatar

Delay By One

1 version
Open in App

Delay by one

Delays a stream by one message, emitting a user-defined initial value first so the output is always one step behind the input.

Use this when

  • You need access to the previous value of a stream (e.g. computing a delta between current and previous readings).
  • You are implementing moving averages, change detection, or any temporal comparison.
  • You need to break a feedback cycle with a bootstrapping initial value.

What it does

On the first tick, emits the configured initial value. On every subsequent tick, emits the value that arrived on the previous tick. Input 1, 2, 3, 4 with initial 0 becomes output 0, 1, 2, 3.

Inputs

TypeDescription
tAny single-value stream.

Outputs

TypeDescription
tThe same stream, delayed by one message.

Parameters

NameTypeDescription
initialtThe value emitted on the very first tick.

Works best with

  • A subtraction or comparison component to compute deltas (current - previous).
  • Stateful analytics downstream that need adjacent-value context.

Caveats

  • The initial value type must match the input stream type exactly.
  • Delay is exactly one message — not a time-based delay.

Versions

  • e0342828defaultlatestlinuxTransformation