Skip to content

lib: Make tokio optional by replacing tokio traits with future traits#9443

Draft
OlshaMB wants to merge 1 commit intojj-vcs:mainfrom
OlshaMB:push-vvpntqquqqyo
Draft

lib: Make tokio optional by replacing tokio traits with future traits#9443
OlshaMB wants to merge 1 commit intojj-vcs:mainfrom
OlshaMB:push-vvpntqquqqyo

Conversation

@OlshaMB
Copy link
Copy Markdown
Contributor

@OlshaMB OlshaMB commented May 6, 2026

This enables having custom async runtimes, without having to depend on a huge tokio dependency, just for traits.

tokio is still enabled in testing, and if watchman feature is enabled.

Commit replaces AsyncRead(Ext) from tokio to futures(which is already a dependency), as a sideeffect it uses Cursor from futures.

This commit also gets rid of BlockingAsyncReader by using futures's AllowStdIo

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    an eye towards deleting anything that is irrelevant, clarifying anything
    that is confusing, and adding details that are relevant. This includes,
    for example, commit descriptions, PR descriptions, and code comments.

This enables having custom async runtimes, without having to depend on a huge tokio dependency, just for traits.

tokio is still enabled in testing, and if watchman feature is enabled.

Commit replaces `AsyncRead(Ext)` from tokio to futures(which is already a dependency), as a sideeffect it uses `Cursor` from futures.

This commit also gets rid of `BlockingAsyncReader` by using futures's `AllowStdIo`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit also gets rid of BlockingAsyncReader by using futures's AllowStdIo

nit: If possible (seems like it should be), can you move this to a separate commit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see the point. i will have to use some compat trait, because tokio AsyncRead ≠ futures AsyncRead and replicate AllowStdIo, i really want to split just not sure i can.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I have not heard about AllowStdIo and blindly assumed it was an independent cleanup that could be used with futures::io::AsyncRead.

@OlshaMB
Copy link
Copy Markdown
Contributor Author

OlshaMB commented May 6, 2026

This pr is really a draft, I am not sure about the changes, overall it's positive for non-tokio runtimes, just not sure about experience for tokio users.

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