rt: introduce runtime name#7924
Merged
Darksonn merged 38 commits intotokio-rs:masterfrom Apr 1, 2026
Merged
Conversation
mattiapitossi
commented
Feb 20, 2026
|
|
||
| impl MultiThread { | ||
| #[allow(clippy::too_many_arguments)] | ||
| pub(crate) fn new( |
Member
Author
There was a problem hiding this comment.
Not sure what to do here, I don't feel like name should be in Config, maybe we should moving some other field? Or maybe allowing too_many_arguments in this case might be OK
mattiapitossi
commented
Feb 20, 2026
| /// # } | ||
| /// # } | ||
| /// ``` | ||
| pub fn name(&mut self, val: impl Into<String>) -> &mut Self { |
Member
Author
There was a problem hiding this comment.
Do you think this new API should be gated behind the unstable ff?
mattiapitossi
commented
Feb 20, 2026
| } | ||
|
|
||
| struct FinalConfig { | ||
| name: Option<String>, |
Member
Author
There was a problem hiding this comment.
probably the name could be the first in the order, and so for the diagnostics
Member
Author
|
This is ready for review. I've left some comments regarding few things that might need to be discussed. |
martin-g
reviewed
Mar 3, 2026
martin-g
reviewed
Mar 3, 2026
Member
martin-g
left a comment
There was a problem hiding this comment.
A few more test could be added too:
- a test with
#[tokio::test(name = "a valid name")]and an assertion that the runtime's name() returns "a valid name" - rt_threaded.rs has a test for multi-thread. It would be good to add similar for current-thread
- a test for unnamed runtime, i.e. assert None
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
martin-g
approved these changes
Mar 7, 2026
This was referenced Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #5545
rendered docs