Tokio runtime support #3

Open
opened 2026-04-21 13:33:05 +02:00 by kade · 0 comments
Owner

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.

graph LR
    A[choppa] --> B{Runtime Feature}
    B -->|smol-runtime| C[Smol Executor]
    B -->|tokio-runtime| D[Tokio Executor]
    C --> E[Compression]
    D --> E

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.

# 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. ```mermaid graph LR A[choppa] --> B{Runtime Feature} B -->|smol-runtime| C[Smol Executor] B -->|tokio-runtime| D[Tokio Executor] C --> E[Compression] D --> E ``` 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kade/choppa#3
No description provided.