Skip to content
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

Change all Client methods to async fn #213

Merged
merged 2 commits into from
Aug 16, 2020
Merged

Conversation

ebkalderon
Copy link
Owner

@ebkalderon ebkalderon commented Aug 16, 2020

Changed

  • Change remaining Client notification methods to async fn.
  • Update minimum supported Rust version to 1.41.0.

With this PR, we have eliminated all uses of tokio::spawn in tower-lsp! 🎉 The only things currently tying us to tokio at the moment are the AsyncRead and AsyncWrite traits. The Rust ecosystem is currently split down the middle between the tokio and futures/async-std versions of these traits, unfortunately, although efforts exist to stabilize them in std.

Closes #180.

This not only guarantees a correct order of operations, but it
eliminates the very last internal call to `tokio::spawn()` in the
project. The only thing currently tying us to `tokio` specifically is
the `AsyncRead`/`AsyncWrite` traits.
This version includes a critical fix for `format!()` calls in async fn:

rust-lang/rust#64856
@ebkalderon ebkalderon self-assigned this Aug 16, 2020
@ebkalderon ebkalderon merged commit b30b112 into master Aug 16, 2020
@ebkalderon ebkalderon deleted the client-notifs-async-fn branch August 16, 2020 06:06
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.

Avoid calling tokio::spawn internally
1 participant