-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(console): use tokio task ids in task views #403
Changes from 6 commits
db7554a
e96be29
c5e9d69
5e52bc5
2f2332e
a14fb75
d2e00c1
ce5c111
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ impl TableList<11> for TasksTable { | |
warnings, | ||
Cell::from(id_width.update_str(format!( | ||
"{:>width$}", | ||
task.id(), | ||
task.task_id().map(|id| id.to_string()).unwrap_or_default(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since the task ID is not going to change over the lifetime of the task, and we have to format an ID for each task every time we draw the task list, i wonder if we want to cache a string representation of the task's ID as soon as we receive a task --- we could have an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to check the docs, but do we really have to format all rows in a table every time it's opened? Do we not only format the visible rows? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. er, that's what i meant. the point is that this work is performed every time we redraw the table. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, got it. I understand now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hawkw I've made some changes to store a string of the id. Please let me know if this is what you had in mind. |
||
width = id_width.chars() as usize | ||
))), | ||
Cell::from(task.state().render(styles)), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing
,
here (i think that was my fault, sorry!)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, rustc caught that one for me, I didn't notice it either. (-;
I needed to use
name.as_ref().to_owned()
here becausename
is anInternedStr
. Not sure if there's a better pattern for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, whoops, yeah, that makes sense. I assumed it was just a string.