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

Intercept ValueTask and ValueTask<T> #88

Open
hivanov opened this issue Mar 5, 2020 · 2 comments
Open

Intercept ValueTask and ValueTask<T> #88

hivanov opened this issue Mar 5, 2020 · 2 comments

Comments

@hivanov
Copy link

hivanov commented Mar 5, 2020

The types ValueTask and ValueTask<T> are not intercepted with the async interceptor, always going through the InterceptSynchronous method.

@hivanov
Copy link
Author

hivanov commented Mar 6, 2020

Update: it seems that ValueTask and ValueTask<T> methods are forced to completion, and thus go through InterceptSynchronous. Maybe that's the reason why we've got this discrepancy.

@JSkimming
Copy link
Owner

@hivanov

The discrepancy is because this library does not consider ValueTask and ValueTask<T> (it predates them by a few years) and it determines whether a method is asynchronous based on it returning Task or Task<T>.

PRs are always welcome. Almost all the secret source is in the class AsyncDeterminationInterceptor, that's where you should start looking if you want support for ValueTask and ValueTask<T>.

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

No branches or pull requests

2 participants