parseq icon indicating copy to clipboard operation
parseq copied to clipboard

Can't name parallel Tasks

Open avik-das opened this issue 5 years ago • 2 comments

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.

avik-das avatar Mar 27 '19 00:03 avik-das

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!

r00pal avatar Oct 01 '20 13:10 r00pal

@r00pal that's correct, but you can't name the actual parent task that runs task1 and task2 in parallel. It would still be helpful to see names of the groupings.

avik-das avatar Oct 01 '20 16:10 avik-das