Skip to content

Document each operator#286

Merged
jachris merged 4 commits intotopic/new-executorfrom
topic/spawn-operator
Apr 29, 2026
Merged

Document each operator#286
jachris merged 4 commits intotopic/new-executorfrom
topic/spawn-operator

Conversation

@jachris
Copy link
Copy Markdown
Contributor

@jachris jachris commented Apr 29, 2026

Summary

  • Add reference pages for the new each and group operators.
  • Add a routing guide for dynamic fan-out with subpipelines, covering when to use each, group, fork, parallel, and load_balance.
  • Add reciprocal See Also links and update the operator index and sidebar.
⚙️ Code PR: tenzir/tenzir#5981

@github-actions github-actions Bot added the reference Reference documentation label Apr 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

📦 Preview  ·  View →  ·  ⚪ Removed

Comment thread src/content/docs/reference/operators/each.mdx Outdated
Comment thread src/content/docs/reference/operators/each.mdx Outdated
Comment thread src/content/docs/reference/operators/each.mdx Outdated
Comment thread src/content/docs/reference/operators/each.mdx Outdated
Comment thread src/content/docs/reference/operators/each.mdx Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1ca47295d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/content/docs/reference/operators/each.mdx Outdated
@jachris jachris changed the base branch from main to topic/new-executor April 29, 2026 11:58
@jachris jachris force-pushed the topic/spawn-operator branch from d1ca472 to 46bbe0a Compare April 29, 2026 12:00
@github-actions github-actions Bot added guide How-to guides site Site infrastructure labels Apr 29, 2026
jachris and others added 3 commits April 29, 2026 14:01
Adds reference page for the new `each` operator, which spawns a subpipeline
per incoming event with the event bound to `$this`. Adds reciprocal See
Also links from `cron`, `every`, and `parallel`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Reword the source/output description (no more "or sinks them itself").
- Move the queueing note next to the parallel parameter.
- Say the subpipeline must start with a source.
- Drop the trivial "re-emit" example.
- Replace the load_http example with a per-event sink example.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous example used `subscribe` and `to`, neither of which is ported to
the new executor yet. Replace with `from`/`to_file` using `write_ndjson`
inside the sink so the example actually runs under `tenzir --neo`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jachris jachris force-pushed the topic/spawn-operator branch from 46bbe0a to 67ea4bf Compare April 29, 2026 12:01
Add a routing guide that explains how to use each and group for dynamic subpipeline fan-out. The guide compares them with fixed fan-out operators and shows per-event lookups and keyed sinks.

Also add a group reference page and expand the each reference with a more realistic lookup example and guide links.

Assisted-by: ChatGPT (pi)
@mavam mavam force-pushed the topic/spawn-operator branch from 4733d23 to a81afc1 Compare April 29, 2026 15:46
Copy link
Copy Markdown
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The new guide gives and the right guide-level treatment, and the reference pages now link readers to the broader fan-out guidance.

Copy link
Copy Markdown
Member

@mavam mavam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The new guide gives each and group the right guide-level treatment, and the reference pages now link readers to the broader fan-out guidance.

@jachris jachris merged commit 1a63234 into topic/new-executor Apr 29, 2026
7 checks passed
@jachris jachris deleted the topic/spawn-operator branch April 29, 2026 15:55
jachris added a commit to tenzir/tenzir that referenced this pull request Apr 30, 2026
Adds `each { ... }` which, for each incoming event, substitutes the
event's record as `$this` into a fresh copy of the subpipeline and
spawns it as a void-input (source) pipeline. Outputs from all
subpipelines are forwarded. An optional `parallel=N` argument (default
10) caps concurrent instances; excess rows queue and drain one-by-one as
subpipelines finish.

This required adding `OperatorState::blocked` to `async.hpp` and
updating the executor to stop consuming upstream messages when an
operator returns `blocked`, while still processing subpipeline
completions and control messages.

Start with `executor.cpp` for the backpressure change, then `each.cpp`
for the operator itself. The `state()` / `finish_sub` / `todo_`
interaction is the key flow to follow.

<sub>
📚 Docs PR: tenzir/docs#286
</sub>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

guide How-to guides reference Reference documentation site Site infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants