Skip to content

POC: Separating outbound/inbound stream state - #1135

Closed
nmittler wants to merge 3 commits into
grpc:masterfrom
nmittler:stream_redesign
Closed

nmittler wants to merge 3 commits into
grpc:masterfrom
nmittler:stream_redesign

Conversation

@nmittler

Copy link
Copy Markdown

The stream class structure has become a bit complicated and hard to understand. Much of this is due to the fact that we have so many special cases for client/server, okhttp/netty, etc.

I think that we can begin to simplify the code a bit by pulling out the core logic that compose the inbound and outbound state of the streams into specialized classes. This PR is a first-cut at what this might look like.

@nmittler

Copy link
Copy Markdown
Author

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems odd to have a class named OutboundState maintaining control to the Framer. I don't have a better idea what to call it, just my opinion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In writing tests for AbstractStream, I found it was pretty annoying to not be able to provide a framer for testing purposes. In the spirit of passing in dependencies, perhaps you can make a constructor that allows passing one in?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I share your pain. I was originally calling it OutboundContext, but was worried it might cause confusion with the context API. I'm definitely open to alternatives.

@carl-mastrangelo

Copy link
Copy Markdown
Contributor

Overall I like the direction. I would like to see how this fits into AbstractStream though, since I suspect that will be tricky to do cleanly.

@nmittler

Copy link
Copy Markdown
Author

@carl-mastrangelo @ejona86 PTAL ... renamed the class to MessageSender. Hopefully that's a better name :)

nmittler added 2 commits October 23, 2015 13:17
The stream class structure has become a bit complicated and hard to understand. Much of this is due to the fact that we have so many special cases for client/server, okhttp/netty, etc.

I think that we can begin to simplify the code a bit by pulling out the core logic that compose the inbound and outbound state of the streams into specialized classes.  This PR is a first-cut at what this might look like.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some more interface comments here? Stuff like can this throw, what thread this can be called from, that kinda stuff.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@carl-mastrangelo

Copy link
Copy Markdown
Contributor

Since this is a refactor PR, I figured I would add in some other comments.

@nmittler

nmittler commented Nov 4, 2015

Copy link
Copy Markdown
Author

@ejona86 any thoughts on this?

@ejona86

ejona86 commented Nov 4, 2015

Copy link
Copy Markdown
Member

I'm okay with something like this, but this in particular seems a bit strange to me. Sender looks like AbstractStream to me. I would have expected the opposite, where everything currently in Sender is AbstractStream and everything else in AbstractStream moved elsewhere. Maybe it will be more clear when hooked up.

It's still good that inbound and outbound is split, so I could be okay with this change.

@ejona86

ejona86 commented Sep 21, 2018

Copy link
Copy Markdown
Member

We went with #1656 for splitting outbound/inbound state.

@ejona86 ejona86 closed this Sep 21, 2018
@thelinuxfoundation

Copy link
Copy Markdown

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants