akka.net
akka.net copied to clipboard
Hide task scheduler
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
- [x] I have reviewed my own pull request.