Skip to content

Hide task scheduler - #7074

Open
Zetanova wants to merge 4 commits into
akkadotnet:devfrom
Zetanova:hide-task-scheduler
Open

Zetanova wants to merge 4 commits into
akkadotnet:devfrom
Zetanova:hide-task-scheduler

Conversation

@Zetanova

Copy link
Copy Markdown
Contributor

Fixes #
Leaking the ActorCell Task Scheduler to the async execution.

Changes

TaskSchedulerExecutor will schedule work with the Task.CreationOptions.HideScheduler flag set.
The executor is used by the default-executor and channel-executor

This will prevent mistakenly leaking the used ActorCell TaskScheduler to EF-Core or other frameworks

This will make following both statements equal (the are currently not equal):

bool Receive(object message) {
    //statement 1
    Task.Run(MyTaskAsync()).PipeTo(Self);

   //statement 2
   MyTaskAsync().PipeTo(Self);

   async Task<object> MyTaskAsync() {
        //demo async process
        return "done";
   }
}

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants