-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeDB Client Rust dependencies: async runtimes, tokio-stream #423
Conversation
PR Review ChecklistDo not edit the content of this comment. The PR reviewer should simply update this comment by ticking each review item below, as they get completed. Trivial Change
Code
Architecture
|
@@ -11,3 +11,4 @@ target | |||
Cargo.lock | |||
Cargo.toml | |||
!library/crates/Cargo.toml | |||
!library/crates/Cargo.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crates-universe depends on this Cargo.lock to be present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? How was it working before we had this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.gitignore
only affects files that aren't tracked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it was working because we'd generated Cargo.lock
files on our local machines and that was allowing the update script to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it was already present and tracked, modifications would be detected by git.
I discovered that this was a problem when I removed Cargo.lock through IDEA's project tree view, which runs git rm ...
. git
then promptly ignored the newly generated lockfile, because it was no longer tracked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please include a couple of the most important crate names in the PR title so that it's more "unique" (currently the same PR title could be applied to >10 different PRs).
Something like "TypeDB Client Rust dependencies (async-std
, tokio-stream
, etc.)"
@@ -11,3 +11,4 @@ target | |||
Cargo.lock | |||
Cargo.toml | |||
!library/crates/Cargo.toml | |||
!library/crates/Cargo.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? How was it working before we had this?
tokio = { version = "=1.24.1", features = ["rt", "rt-multi-thread"] } | ||
tokio-stream = "=0.1.11" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why Tokio packages their stream library as a separate crate, as opposed to what they normally do, namely shipping it as a feature of tokio
crate itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TL;DR: tokio's minimum supported Rust version does not support streams.
https://docs.rs/tokio/latest/tokio/stream/
Originally, we had planned to ship Tokio 1.0 with a stable Stream type but unfortunately the RFC had not been merged in time for Stream to reach std on a stable compiler in time for the 1.0 release of Tokio. <...> [O]nce
Stream
has made it into the standard library and the MSRV period has passed, we will implement stream for our different types.
What is the goal of this PR?
We add dependencies used by TypeDB Client Rust for async runtime independence tests.
What are the changes implemented in this PR?
tokio-stream
: utility, maps tokio mpsc channel receivers to streams;http
: remove a layer of indirection;smol
andasync-std
: popular async runtimes.