rust-lang / rust-lang/rust

Tracking Issue for `is_disconnected` functions for mpsc and mpmc channels

Open
#153,668 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-tracking-issue S-tracking-unimplemented T-libs
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.)

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.