Tokio runtime support #3
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kade/choppa#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tokio Runtime Support
Choppa currently uses the smol runtime by default for compatibility with shell-pool and blitz integration. The smol runtime provides lightweight async operations suitable for the compression workload, but broader compatibility with services using the tokio ecosystem is needed for wider adoption across the Reynard monorepo.
Adding tokio runtime support requires implementing a feature flag to allow users to choose between smol and tokio runtimes. The tokio runtime feature flag will enable services that already use tokio to integrate choppa without introducing runtime conflicts. This involves implementing an async executor for tokio that provides the same interface as the existing smol executor.
The implementation requires updating the feature flags in Cargo.toml to include tokio as an optional dependency. The current configuration has smol-runtime as the default feature with dependencies on smol, async-executor, async-io, async-net, futures-lite, and async-lock. The tokio-runtime feature needs to be added with tokio as a dependency.
Documentation updates are necessary to explain the runtime options and when to use each runtime. Tokio-specific tests should be added to ensure the tokio executor works correctly with all compression modes and filters. This feature is mentioned in the README.md and is required for services using the tokio runtime such as gatekeeper and mappy.