-
Notifications
You must be signed in to change notification settings - Fork 592
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
Implement full async channel #982
Conversation
@@ -121,6 +121,12 @@ private void ParseHeaderFrame(in InboundFrame frame) | |||
throw new UnexpectedFrameException(frame.Type); | |||
} | |||
|
|||
if (totalBodyBytes == 0) |
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 was an exception thrown when ConsumerWorkService if the array was null (which was not caught due to an empty catch in the ConsumerWorkService, see other comment)
{ | ||
// ignored | ||
_channelBase.OnUnhandledExceptionOccurred(e, "ConsumerWorkService"); |
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.
This is the empty catch I patched up
|
||
namespace RabbitMQ.Util | ||
{ | ||
internal class SetQueue<T> |
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.
Was not used at all
@@ -34,7 +34,7 @@ | |||
using System.IO; | |||
using System.Reflection; | |||
|
|||
namespace RabbitMQ.Util | |||
namespace Unit |
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.
Was only used in tests, so I moved it there
{ | ||
if (waitForConfirmation) | ||
{ | ||
// TODO 8.0 - Call ModelRpc |
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.
I left various TODO 8.0 -
in the code, this needs fixing in futher PRs
Mind taking a look at this? @stebet @bording @michaelklishin |
I can't yet request formal reviews, but I would like to start having a discussion about these changes as they should mark the direction of 8.0. |
I'll take a look at this tomorrow :) |
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.
Sorry wasn't able to finish the whole thing. I have limited time at my hands before christmas. Here are a few thoughts
/// for use in acknowledging received messages, for instance. | ||
/// </summary> | ||
public IModel Model { get; set; } | ||
public IChannel Channel { get; set; } |
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.
I love how channel is better aligned with the purpose
_disposed = true; | ||
} | ||
|
||
void IDisposable.Dispose() |
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.
I don't see much value in implementing both IDisposable
as well as IAsyncDisposable
. Especially not because the first one requires us to do evil sync over async. Let's embrace async properly in v8
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.
We can think about dropping IDisposable, but there might be some drawbacks with it (e.g. DI container might not fully support it or 🤷♂️ )
I do not know what's the best way forward for this.
Well it's a big change and any feedback is very much appreciated! Regarding the questions about async in Consumer / Connection, as the PR was already quite huge, so I've tried to limit changes outside of the IModel/IChannel for a future PR. I think it's simple to do changes to full async all the way stepwise. But yes all of it should be modified! |
I will hopefully be able to bring this PR up-to-date once #1199 is merged. |
I reverted #1202 because it makes back and forward-porting impossible unless all maintained branches adopt file-scoped namespaces. |
I'm swamped with other stuff right now, so I do not have a lot of time to invest in this. So if you/someone can take over, that would be great. |
I'll take a quick look to see how much work this is to merge and go through before suggesting we take an approach like splitting it up into smaller PRs |
Thanks @stebet |
@stebet I'm starting on porting these changes to |
Proposed Changes
Implements the proposal (#970) except the wait for confirmation part (will be done later to keep this PR "smaller") and some smaller modification / renamings along the way.
Types of Changes
Checklist
CONTRIBUTING.md
documentFurther Comments
Open questions