-
Notifications
You must be signed in to change notification settings - Fork 598
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
Review async RPC continuations, await, and ConfigureAwait #1427
Comments
One thing you must have in mind is that It needs to be wherever the |
@paulomorgado Yes I realize that, but in this case, with the original implementation of |
If Check out the ConfigureAwait FAQ. (I'm sorry, but I'm not on a device where I can check that). |
Thank you @paulomorgado for the explanation. Since |
OK, I have modified |
@lukebakken There was no issue, it was just that the previous version of the code didn't require It is similar to |
Thanks for the clarification @danielmarbach. I thought the previous version was correct, but I think having an explicit |
I think that should be left only for non-cancelable APIs. All other should already have a cancellation token and that one should be combined with a timeout cancellation token, when a timeout is required. |
cc @paulomorgado @danielmarbach
Discussion about
.ConfigureAwait(false)
that prompted this issue:#1426 (comment)
The current implementation of
AsyncRpcContinuation<T>
is such that the awaitable is configured in the class itself, here:https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/projects/RabbitMQ.Client/client/impl/AsyncRpcContinuations.cs#L72-L78
This means that
await k
does not use.ConfigureAwait(false)
:https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/main/projects/RabbitMQ.Client/client/impl/ChannelBase.cs#L256
The original implementation of
AsyncRpcContinuation<T>.GetAwaiter()
returned aTaskAwaiter<T>
:...however, even with the above code,
await k
does not allow.ConfigureAwait(false)
:So, my questions are:
.ConfigureAwait(false)
?The text was updated successfully, but these errors were encountered: