tokio-rs / tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
https://tokio.rs
MIT License
25.72k stars 2.35k forks source link

Missing methods `join_set::Builder::spawn_blocking()` and `join_set::Builder::spawn_blocking_on()` #6565

Closed jbg closed 1 month ago

jbg commented 2 months ago

Is your feature request related to a problem? Please describe.

I want to name a blocking task that is spawned on a JoinSet.

Describe the solution you'd like

The missing methods spawn_blocking() and probably spawn_blocking_on() added to join_set::Builder.

Describe alternatives you've considered

I'm currently spawning the tasks without names, but I prefer everything to be named for ease of debugging with tokio-console.

Darksonn commented 2 months ago

I would be happy to accept a PR for this.

hi-rustin commented 2 months ago

I am working on it.