hyperium / hyperium/hyper

tokio::spawn should have task names

Open
#2,645 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

B-upstream C-feature
Dominant language
Rust
Stars
16.3k
Forks
1.8k
Avg merge
1d 22h
Merged PRs (30d)
14

Description

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Using the console, it would be nice if hyper had some task names
Describe the solution you'd like
A clear and concise description of what you want to happen.
Implement a custom function for spawning something with a named parameter. Here is some code I wrote up:

pub fn spawn_named<T>(
	name: &str,
	future: impl std::future::Future<Output = T> + Send + 'static,
) -> tokio::task::JoinHandle<T>
where
	T: Send + 'static,
{
	#[cfg(tokio_unstable)]
	return tokio::task::Builder::new().name(name).spawn(future);

	#[cfg(not(tokio_unstable))]
	tokio::spawn(future)
}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
N/A
Additional context
Add any other context or screenshots about the feature request here.

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 by locating hyper's tokio::spawn call sites and reviewing how task creation is currently handled. Compare those sites with the proposed spawn_named function and its tokio_unstable fallback. Done means the relevant hyper tasks can receive names without changing behavior when named spawning is unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.