Can't name parallel Tasks
avik-das opened this issue · 2 comments
avik-das commented
None of the overloads for Task.<T>par(...)
allow specifying a string description. The underlying implementation, Par2Task
, etc. have the desc
field, which is simply set to something like par
, par2
, etc. When looking at a trace, this makes it hard to understand where a parallel task is defined in the code.
Is there a fundamental reason why there are no overloads for Task.<T>par(...)
which accept a human-readable description? I'm happy to add these overloads if there's no objection.
r00pal commented
When you are making a task, you can add the name, Something like this
Task<String> task1 = Task.blocking("meaningful_task_name", () - > {
//task logic
});
Task<String> task2 = Task.blocking("meaningful_task_name_2", () - > {
//task logic
});
Task.par(task1, task2);
Hope this helps!