Skip to content

Conversation

@danielcweber
Copy link
Collaborator

No description provided.


public AsyncInvocation(IScheduler self, TState s, Func<IScheduler, TState, CancellationToken, Task<IDisposable>> action)
{
action(new CancelableScheduler(self, _cts.Token), s, _cts.Token).ContinueWith(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't execute this in the constructor in case the class initialization hasn't become properly visible at this point. This could be a plain method returning this and simply use return new AsyncInvocation().Run(self, s, action);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Fixed in a minute.

@danielcweber danielcweber merged commit 11c9f7d into dotnet:master Jul 2, 2018
@danielcweber danielcweber deleted the OptimizeScheduleAsync branch July 2, 2018 07:58
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