linkedin/parseq

Can't name parallel Tasks

avik-das opened this issue · 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.

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 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.