docs: two runnable examples for the stateful and composite features - #14
Merged
Merged
Conversation
Collects the open extension ideas in one place: more examples for the newer features, named merge slots, several named graph inputs, stage labels with typed access, tracking which stage short-circuited, a config-aware registerMergeFilter, an injectable registry with duplicate detection, the documentation items around 0..n outputs and large messages, and the two limitations the README lists. Each item says what the library does today, the gap, a proposal with an API sketch, its compatibility impact and the workaround available in the meantime. Nothing here is implemented. The README roadmap now summarizes the list and links to it; its short-circuit item moved into TODO.md unchanged.
apps/textPipeline covers the core building blocks; the features that shipped since had no runnable example. Two samples fill the gap, in the same style (numbered blocks, comments that explain the why), each walked through in EXAMPLE.md: - statefulPipeline (section 8): a stage that accumulates across messages and flushes in finish(), handing its result to the application through the GraphContext; a merge with per-instance state and per-instance arguments (subclass + FilterRegistrar) next to the shared-combiner semantics of registerMergeFilter, shown with a captured counter; an application's own derived context, recovered with as<AppContext>(). - compositePipeline (section 9): registerTypedMergeFilter and the JSON JoinFilter side by side; a DslFilterGraph registered as a stage of an outer graph, with finish() and the context reaching into it; a Void-terminated sink graph; the in-band tick message that stands in for a tick() hook. Also refreshes the textPipeline output in EXAMPLE.md, which predates the typed-merge stages, and drops the examples item from TODO.md. No library change; the new files follow the style of the existing sources.
Owner
Author
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # README.md # TODO.md Co-authored-by: psyinf <1777736+psyinf@users.noreply.github.com>
Contributor
Done — I merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #13 (base
docs/todo), so its diff shows only the examples. Retargetto
mainonce #13 merges.apps/textPipelinecovers the core building blocks; everything that shippedafter it had no runnable example. Two samples fill that gap, in the same style
(numbered blocks, comments that explain the why), each walked through in
EXAMPLE.md:
apps/statefulPipeline(EXAMPLE.md section 8) — stages that carry state:finish()and hands itsresult to the application through the
GraphContext;TypedMergeFiltersubclass + a
FilterRegistrarcreator), two instances with different windowsin one graph;
registerMergeFiltermadevisible with a captured counter — the numbers run straight through both stage
instances, which is item 5 of TODO.md;
as<AppContext>().apps/compositePipeline(EXAMPLE.md section 9) — composing graphs:registerTypedMergeFilterand the JSONJoinFilterside by side, producingthe same result;
DslFilterGraphregistered as a stage of an outer graph, showing that bothfinish()and the context reach the inner stages;Void-terminated sink graph (a deliberate dead end, not a drop);tick()hook.Also in this PR:
"complete output" block is refreshed — it predates the typed-merge stages and
was missing their two lines.
No library change. Verified with
windows-msvc-debug-developer-mode: bothsamples build warning-free, their output is what EXAMPLE.md prints, and
ctestis 85/85.A note on formatting: clang-format 22 with this repo's
.clang-formatwants 2-spaceconstructor initializers and collapsed one-line bodies, which no committed source
uses, so the new files follow the existing sources rather than the formatter. The
cpp-linter job (clang-format 16, changed lines only) may still comment.