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

User should be able to provide context class when using async methods #240

Merged

Conversation

ThiagoT1
Copy link
Contributor

@ThiagoT1 ThiagoT1 commented Feb 4, 2020

Attempts to fix #239 .

If the Functions class depends on the Context instance, async methods will make it fail with a Null Reference Exception.

As per #238, full adherence to TLP semantics would see callbacks on the Functions class gone, maybe replaced by injected middleware semantics, ASPNET.CORE style.

@msftclas
Copy link

msftclas commented Feb 4, 2020

CLA assistant check
All CLA requirements met.

@badrishc
Copy link
Contributor

badrishc commented Feb 4, 2020

The reason we did not include Context in the async API is that there seemed to be no good use case for contexts in the async world, since the call stack is available after the await.

But yes, I agree it still makes sense to let users provide it because Functions expect the same.

@ThiagoT1
Copy link
Contributor Author

ThiagoT1 commented Feb 5, 2020

We could merge this so users can switch seamlessly between blocking and async code, then.

@badrishc badrishc merged commit 8f14cf4 into microsoft:master Feb 5, 2020
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.

[C#] ClientSession Async Methods Fail Without Context
3 participants