lib: Make tokio optional by replacing tokio traits with future traits#9443
lib: Make tokio optional by replacing tokio traits with future traits#9443OlshaMB wants to merge 1 commit intojj-vcs:mainfrom
Conversation
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`
There was a problem hiding this comment.
This commit also gets rid of
BlockingAsyncReaderby using futures'sAllowStdIo
nit: If possible (seems like it should be), can you move this to a separate commit?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Fair enough. I have not heard about AllowStdIo and blindly assumed it was an independent cleanup that could be used with futures::io::AsyncRead.
|
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. |
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 usesCursorfrom futures.This commit also gets rid of
BlockingAsyncReaderby using futures'sAllowStdIoChecklist
If applicable:
CHANGELOG.mdREADME.md,docs/,demos/)cli/src/config-schema.json)how it works, how it's organized), including any code drafted by an LLM.
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.