Skip to content

DependsOnAsync, AddTasksAsync and DoAsync naming #305

Open
@mzorec

Description

@mzorec

Suggestion from @huanlin :

While fixing this bug, one idea popped up:

The tasks configured with DependsOnAsync method are actually executed with Task.Run, which is arguably not asynchronous calls. I mean the following code in TaskBase.cs:

protected virtual async Task<TResult> DoExecuteAsync(ITaskContextInternal context)
{
    return await Task.Run(() => DoExecute(context));
}

Having said that, I don't have better ideas to run those "Async" tasks simply because we don't know what those user-defined tasks really do (could be CPU-bound or I/O bound).

I'm just feel that DependsOnAsync might mislead people, make them think that those tasks are executed with C# asynchronous calls.

So one possible change is to rename DependsOnAsync to something else, maybe DependsOnParallel or DependsOnConcurrently ?

I may be wrong or missed something though. So this is just a note. No further action requested. (discussions are welcomed)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions