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

sync: misc improvements #1210

Closed
4 of 5 tasks
carllerche opened this issue Jun 27, 2019 · 2 comments
Closed
4 of 5 tasks

sync: misc improvements #1210

carllerche opened this issue Jun 27, 2019 · 2 comments
Labels
A-tokio Area: The main tokio crate C-musing Category: musings about a better world M-sync Module: tokio/sync
Milestone

Comments

@carllerche
Copy link
Member

carllerche commented Jun 27, 2019

Tracking misc smaller improvements to tokio-sync.

This issue is to be closed once there are no remaining breaking changes to make or remaining breaking changes are tracked in separate issues.

Changes

  • Consider switching Lock to borrow.
  • Consider moving AtomicWaker into dedicated crate or some other crate.
  • Investigate &mut self requirement for UnboundedSender.

Tests

  • Fix tests/lock.rs; fn lock(). The test depends on thread timing.

async / await

Add async / await APIs for:

Polish

Documentation

  • Ensure all APIs are documented with examples.
@carllerche carllerche added this to the v0.2 milestone Jun 27, 2019
carllerche added a commit that referenced this issue Jun 27, 2019
Adds:

- oneshot::Sender::close
- mpsc::Receiver::recv
- mpsc::Sender::send

Also renames `poll_next` to `poll_recv`.

Refs: #1210
carllerche added a commit that referenced this issue Jun 27, 2019
Adds:

- oneshot::Sender::close
- mpsc::Receiver::recv
- mpsc::Sender::send

Also renames `poll_next` to `poll_recv`.

Refs: #1210
@archseer
Copy link

Should the channel implementations be shared with futures-channel?

@carllerche
Copy link
Member Author

@archseer futures-channel is welcome to copy whatever code. I don't know what their design goals are, so I cannot comment on whether or not they would want to copy it.

Given that the Tokio maintainers are the ones that will be maintaining the tokio-sync channel, it is easier for us to keep it in a crate we can publish to.

jonhoo added a commit that referenced this issue Sep 19, 2019
Locking now only takes &self, with the expectation that you place the
Mutex in an Arc (or something similar) to share it between threads.

Fixes #1544.
Part of #1210.
jonhoo added a commit that referenced this issue Sep 19, 2019
This renames `Lock` to `Mutex`, and brings the API more in line with `std::sync::Mutex`.

In partcular, locking now only takes `&self`, with the expectation that you place the `Mutex` in an `Arc` (or something similar) to share it between threads.

Fixes #1544.
Part of #1210.
@Darksonn Darksonn added A-tokio Area: The main tokio crate C-enhancement Category: A PR with an enhancement or bugfix. M-sync Module: tokio/sync and removed meta labels Jul 25, 2020
@Darksonn Darksonn added C-musing Category: musings about a better world and removed C-enhancement Category: A PR with an enhancement or bugfix. labels Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-musing Category: musings about a better world M-sync Module: tokio/sync
Projects
None yet
Development

No branches or pull requests

3 participants