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

"Complete the Channel in the catch and outside the catch"? #15408

Open
Daniel15 opened this issue Oct 31, 2019 — with docs.microsoft.com · 2 comments

Comments

Copy link
Contributor

@Daniel15 Daniel15 commented Oct 31, 2019 — with docs.microsoft.com

This article has a note:

Wrap logic in a try ... catch. Complete the Channel in the catch and outside the catch to make sure the hub method invocation is completed properly.

This is worded pretty clumsily and doesn't match the code snippet underneath (which just completes the channel under the try-catch, not "in the catch").

I think what it's trying to say is that you should complete the channel either in a finally block or underneath a try-catch block, such that it's always called, even if an exception is thrown.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@bradygaster

This comment has been minimized.

Copy link
Member

@bradygaster bradygaster commented Nov 6, 2019

@BrennanConroy feels like it'd benefit this doc for us to change the sample code to highlight the IAsyncEnumerable approach versus Channel. Yay/Nay?

@BrennanConroy

This comment has been minimized.

Copy link
Member

@BrennanConroy BrennanConroy commented Nov 7, 2019

it'd benefit this doc for us to change the sample code to highlight the IAsyncEnumerable

The bit above the Channels part shows IAsyncEnumerable, we just need to update the comment for the Channels section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.