-
Notifications
You must be signed in to change notification settings - Fork 615
Missing ConfigureAwait in TcpClientAdapter #897
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
Conversation
|
@danielmarbach The else case is an extension method from the |
| } | ||
|
|
||
| await ConnectAsync(ep, port); | ||
| await ConnectAsync(ep, port).ConfigureAwait(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any difference in using ConfigureAwait(false) at the end of the method? After all, after this line there is no code and there is no next step of the state machine. Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no difference. Context capturing is applied to the continuation which is the end of the method. Though in general libs that don't need context capture should always opt out for every await. It would be best to even enable i.ex. Fxcop even if only https://docs.microsoft.com/en-us/visualstudio/code-quality/ca2007?view=vs-2019 is activated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Also I use ca2007 in everyday work. I have to always disable its warnings for test projects.
Proposed Changes
Types of Changes
What types of changes does your code introduce to this project?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.
CONTRIBUTING.mddocumentFurther Comments
@bording I also saw this
any reasons why we are not using
and then what I also wondered is if the else case ever exists? I can't find that method overload. Judging by the history it started with
https://github.com/rabbitmq/rabbitmq-dotnet-client/blame/696ed9be4e337f8472b32f85bd95bc46a48ca781/projects/client/RabbitMQ.Client/src/client/impl/TcpClientAdapter.cs#L35-L39
Any ideas? Something seems off