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

tokio: provide future / stream / sink helpers #1225

Closed
3 tasks
carllerche opened this issue Jun 28, 2019 · 3 comments
Closed
3 tasks

tokio: provide future / stream / sink helpers #1225

carllerche opened this issue Jun 28, 2019 · 3 comments
Milestone

Comments

@carllerche
Copy link
Member

carllerche commented Jun 28, 2019

Currently, the goal is to update master to use std::future. There currently are no future helpers provided by std. However, there are helpers provided by futures-rs and other locations.

tokio must decide how it will depend on external crates for both private and public usage as well as what helpers tokio will provide itself.

Fix TODO

This list tracks places in the code base that had temporary code applied to get things working and need a second pass.

  • tokio-threadpool/tests/threadpool.rs
  • tokio-timer/tests/hammer.rs
  • tokio-timer/tests/timeout.rs

Refs: rust-lang/futures-rs#1701, rust-lang/futures-rs#1700

@carllerche carllerche added this to the v0.2 milestone Jun 28, 2019
carllerche added a commit that referenced this issue Jun 30, 2019
* timer: restructure feature flags
* update timer tests
* Add `async-traits` to CI

This also disables a buggy `threadpool` test. This test should be fixed in the future.

Refs #1225
@carllerche carllerche changed the title tokio: provide future / stream helpers tokio: provide future / stream / sink helpers Jul 3, 2019
@carllerche
Copy link
Member Author

Switch to futures-sink: #1244

@rubdos
Copy link
Contributor

rubdos commented Jul 11, 2019

This sounds like it's "decided" to use futures-preview then? A Stream trait would be very useful, since even the examples cannot be cleanly written without one. Even if you wrote #1242 (async fn accept()) to avoid importing Stream, iterating over items in Framed also becomes cumbersome! (Found out while rewriting examples)

@carllerche
Copy link
Member Author

As of now, Tokio will add a public dependency on the Stream / Sink traits. Internals, tests, and examples can use the helpers for those traits provided in futures-util.

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

No branches or pull requests

2 participants