Tracking Issue for `is_disconnected` functions for mpsc and mpmc channels
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(mpsc_is_disconnected)] and #![feature(mpmc_channel)]
This is a tracking issue for the is_disconnected methods on mpsc and mpmc channels.
With these methods you'll be able to check if all Sender/Receivers on a channel have disconnected.
Public API
#![feature(mpsc_is_disconnected)]
use std::sync::mpsc::channel;
let (tx, rx) = channel::<i32>();
assert!(!tx.is_disconnected());
drop(rx);
assert!(tx.is_disconnected());
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: https://github.com/rust-lang/libs-team/issues/748
- Implementation: https://github.com/rust-lang/rust/pull/153170
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- How can we document this so that users do not from race conditions.
- Will std get the ability to re-connect channels? If so what does that mean for this feature?
- Can we add a clippy feature to detect the
if !tx.is_disconnected() { tx.send() }racing form.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the public API and review the linked implementation PR, rust-lang/rust#153170. Then read the unresolved questions about race-condition documentation, reconnection semantics, and a possible Clippy check. Done means completing the final comment period and stabilization work for the mpsc and mpmc is_disconnected methods.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100