dotnetcore / dotnetcore/FlubuCore

DependsOnAsync, AddTasksAsync and DoAsync naming

Open
#305 4 comments 0 reactions 0 assignees View on GitHub
Discussion needed Documentation Proposal
Dominant language
C#
Stars
937
Forks
99
PR merge metrics
No merged PRs in 30d

Description

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:
>
> ``` C#
> protected virtual async Task 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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.