Wait
Synopsis
Introduces a time delay in the processing pipeline.
Schema
- wait:
timeout: <numeric>
description: <text>
if: <script>
ignore_failure: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>
Configuration
The following fields are used to define the processor:
Field | Required | Default | Description |
---|---|---|---|
timeout | Y | - | Number of seconds to wait/pause |
description | N | - | Explanatory note |
if | N | - | Condition to run |
ignore_failure | N | false | Continue processing if wait fails |
on_failure | N | - | Error handling processors |
on_success | N | - | Success handling processors |
tag | N | - | Identifier |
Details
Introduces a deliberate time delay (pause) in the processing pipeline. The processor waits for the specified number of seconds before allowing the pipeline to continue processing.
The wait processor blocks the current pipeline thread for the specified duration. During this time, other log entries can continue processing in parallel through their own pipeline instances, so overall system throughput is maintained.
The processor is useful for rate limiting, implementing backoff strategies, synchronizing with external systems, or creating deliberate delays for testing and debugging purposes.
Using long timeouts can impact performance by keeping threads and resources allocated longer than necessary. For very long delays (minutes or hours), consider using a different approach such as a message queue with delayed delivery instead of the wait processor.
Examples
Basic
Introducing a simple delay... |
|
pauses processing for 5 seconds |
Conditional
Waiting only under specific conditions... |
|
delays processing for 10 seconds only when rate limited |
Rates
Controling API request frequency... |
|
ensures 2-second spacing between API calls |
Simulating Latency
Adding deliberate latency for testing... |
|
creates artificial delay in test environments only |
Backoff Strategy
Implementing a backoff increases the wait time exponentially between retry attempts |
|