-
Notifications
You must be signed in to change notification settings - Fork 594
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
Issues with 7.0rc1 IAsyncBasicConsumer's method #1601
Comments
Thank you for providing all the details from the start! |
Great, this will be easy to fix. Feel free to open a PR yourself if you'd like! |
will do. |
The problem with this is, Now that the library moved to async, |
Follow-up to #1601 #1601 (comment) cc @bollhals
Follow-up to #1601 #1601 (comment) cc @bollhals
Describe the bug
The new IAsyncBasicConsumer interface has a method
HandleBasicDeliver
and a method parameterReadOnlyBasicProperties
, but with the modifierin
. You can't havein
,ref
in async methods. So as soon as you implement the interface and actually have anything async to do, i.e. you add the async keyword, it won't compile anymore, with CS1988 (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/ref-modifiers-errors#reference-variable-restrictions).rabbitmq-dotnet-client/projects/RabbitMQ.Client/client/api/IAsyncBasicConsumer.cs
Lines 49 to 55 in 2a5aed7
in
basically makes only sense together withref struct
and specificallyref readonly struct
, atleast that's what I understand from all the discussions around https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-11.0/low-level-struct-improvements.I highly recommend simply removing
in
this prior to the 7.0 release, as modifying it would be a breaking change and at the moment implementations would need to jump through loops to use it with async (async local method etc.).In
IBasicConsumer
it's not there:rabbitmq-dotnet-client/projects/RabbitMQ.Client/client/api/IBasicConsumer.cs
Lines 92 to 98 in 2a5aed7
Reproduction steps
See for example:
https://sharplab.io/#v2:EYLgxg9gTgpgtADwGwBYA0AXEBDAzgWwB8ABAJgEYBYAKGIAYACY8gVgG4biBmJ0hgYQYBvGgzFMexABxMkDALIBPeTAwALCABMAFAEsAdgwAqMXBgDKGKAFcwGBvkUA1bABtrMAJSjxQ8eJ8xAF9AhlDuBlhsTQh9V0UGMxs7Y1MLK1sMUJFqfxDqIKA===
Expected behavior
Additional context
No response
The text was updated successfully, but these errors were encountered: