-
Notifications
You must be signed in to change notification settings - Fork 653
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
Add RemovableChannelHandler conformance to MessageToByteHandler #1993
base: main
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
11 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
I must say I'm not sure about my implementation as I'm quite new to the code base. I'll look into tests when I can thought any advice about how to would be appreciated. Should this be a draft PR ? |
I could turn the RemovalState to a Bool but I'm unsure if it then needs a precondition in handlerAdded. https://github.com/AlexisQapa/swift-nio/tree/use-boolean-instead-of-removal-state |
You shouldn't need the precondition in handlerAdded. |
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.
Great, this looks really good! One final note: can you add a few unit tests that test the paths through the removal flow here? That way we won't accidentally regress this behaviour.
Add RemovableChannelHandler conformance to MessageToByteHandler as a follow up for #1991
Motivation:
RemovableChannelHandler conformance was missing MessageToByteHandler while ByteToMessageHandler did conform to it.
Modifications:
Add RemovableChannelHandler conformance to ByteToMessageHandler
Use the same pattern as for ByteToMessage with hooks for encoders to act on removal.
Added hooks have default implementation.
edit: removed context from hooks
Result:
MessageToByteHandler now conform to RemovableChannelHandler.