Skip to content

Fix just_from sink return type - #2318

Open
fallintoplace wants to merge 2 commits into
NVIDIA:mainfrom
fallintoplace:fix/just-from-sink-completion-signatures
Open

fallintoplace wants to merge 2 commits into
NVIDIA:mainfrom
fallintoplace:fix/just-from-sink-completion-signatures

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

What
Return completion signatures from the just_from sink.

Why
Callbacks using auto completions = sink(42); currently fail to compile.

Implementation
Make the runtime sink return the same type as the probe. This also fixes just_error_from and just_stopped_from.

@copy-pr-bot

copy-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@RobertLeahy

Copy link
Copy Markdown
Contributor

What's the use case for auto completions = sink(42);?

Since invoking sink ends the operation performing actions thereafter should, in general, be considered an anti-pattern imo, which makes me think that disallowing auto completions = sink(42); is a feature.

@fallintoplace

Copy link
Copy Markdown
Contributor Author

Fair point, I agree that doing work after completion should be avoided. The intended use case is actually the documented return sink(42, 3.14); example in include/exec/just_from.hpp. The probe sink returns completion_signatures, but the runtime sink returns void, so the documented pattern fails to compile when the operation is started. This change makes the two consistent without requiring additional work after completion.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants