Skip to content

Share client operations across async-io and Tokio runtimes - #82

Draft
tony wants to merge 10 commits into
masterfrom
codex/standard-library-client-core
Draft

tony wants to merge 10 commits into
masterfrom
codex/standard-library-client-core

Conversation

@tony

@tony tony commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Separate the full client's runtime from its object operations. libtmux runs shared async operations with async-io; libtmux-tokio supplies native Tokio process, task, and timer integration. Synchronous callers use .wait(). libtmux-core contains dependency-free values and protocol logic; the usable client still has dependencies.

Run the complete capture programs:

$ cargo run --locked -p libtmux --example api_capture

Run the native Tokio counterpart:

$ cargo run --locked -p libtmux-tokio --example api_capture

Both create an isolated daemon, wait for output, capture it, and clean up. Matching examples also cover construction, listings, creation, queries, cardinality, and input. Both drivers support control mode, plans, bounded admission, retained channel-client quotas, and scoped cleanup. MCP and workspace construction use the Tokio package.

The adapter forwards Server operations and shares the other object types. That preserves shared operation logic but introduces a runtime abstraction and a forwarding surface. Compare the complete blocking design in #66. Both branches retain the same alpha.15 baseline and conflict with later master changes.

Validation on Rust 1.97.1 and tmux 3.6 includes workspace gates, dependency boundaries, shipped examples, cleanup/admission failure controls, and fourteen public HTTPS consumer programs. All six source archives at the current revision repeat byte-for-byte in two assemblies. Public consumer runs use the preview revision; its client implementations and executable examples match this branch. Extracted client archives pass doctests with all features and, independently, with test-support; plain defaults fail examples that require the documented fixture feature. Archived tests use supported local patches for the unpublished sibling packages. These checks establish neither a registry release nor an ordinary PR CI pass.

The live comparison includes commands for this alternative and the blocking design. The documentation publication succeeds; selected deployed content matches its audited artifact after accounting for one exact injected analytics tag per HTML page. Later-trunk integration, older-tmux coverage, release recovery, publisher setup, and operational acceptance remain open. This draft does not establish the requested 9.5/10 adoption scores.

tony added 9 commits October 13, 2026 18:19
why: Callers should be able to construct requests and inspect tmux data
without taking a runtime dependency.

what:
- Add a standalone core, Tokio adapter, and two runnable consumers
- Exercise pane listing, capture, and detached snapshot ownership
- Check the dependency boundary and both consumers in CI
why: A Tokio application and a synchronous caller need the complete tmux
object model without forcing the same executor into both applications.
Keep operation semantics shared while making the runtime dependency an
explicit package choice.

what:
- Move dependency-free values and control parsing into libtmux-core.
- Keep the full client on async-io and expose native Tokio constructors.
- Preserve object operations, control mode, and complete API examples.
- Check workspace re-exports and dependency boundaries on every target.
- Remove the former standalone experiment and its build workflow.
why: A failed signal must not make shutdown wait indefinitely for a
child that is still running. Cleanup must retain ownership until reaping
is confirmed and report its failure on repeated shutdown.

what:
- Share termination and cleanup diagnostics between both process drivers
- Retire numeric process ownership after reaping and disable drop-kill
- Exercise refused signals, retained failures, and bounded Drop paths
- Forward native feature prerequisites and document Git trial installs
why: The synchronous consumer uses async-io through the library and declares no Tokio dependency.

what:
- Match the consumer guide to its Cargo manifest and runtime
The packaged client referenced a README outside its archive. Keep the repository examples covered by a private test crate while the published client includes only its packaged documents.

All three README tests pass and reject a deliberate runtime failure. Twelve migration doctests and package-content checks also pass.
The Tokio package does not ship the shared client source files. Point those references to verified immutable source URLs, while retaining local links for native tests.

All eight referenced files match their public Git blobs, and the package-content check passes.
why: The MCP crate now inherits the workspace Rust 1.97.1 floor.
The old comments describe a separate compiler requirement that no longer exists.

what:
- Remove the obsolete inheritance and File::lock version explanations
- Keep manifest values and the existing locking implementation unchanged

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.

1 participant