Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide task scheduler #7074

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Conversation

Zetanova
Copy link
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