Skip to content

feat: add CommandWrap::spawn_with#33

Open
domenkozar wants to merge 1 commit intowatchexec:mainfrom
domenkozar:feat/spawn-with
Open

feat: add CommandWrap::spawn_with#33
domenkozar wants to merge 1 commit intowatchexec:mainfrom
domenkozar:feat/spawn-with

Conversation

@domenkozar
Copy link

Summary

  • Adds CommandWrap::spawn_with(spawner) method that accepts a custom FnOnce(&mut Command) -> io::Result<Child> closure for spawning
  • Preserves the full wrapper lifecycle (pre_spawn → spawner → post_spawn → wrap_child)
  • Refactors spawn() to delegate to spawn_with(|cmd| cmd.spawn())

Test plan

  • cargo check --features std,tokio1 passes
  • Existing test suite passes (no regressions)

🤖 Generated with Claude Code

Allows callers to provide their own spawning closure instead of the
default `command.spawn()`, useful for platform-specific or custom
spawning mechanisms while preserving the full wrapper lifecycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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