Skip to content
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

Streaming support #34

Closed
xibz opened this issue Mar 21, 2019 · 3 comments
Closed

Streaming support #34

xibz opened this issue Mar 21, 2019 · 3 comments
Assignees
Milestone

Comments

@xibz
Copy link

xibz commented Mar 21, 2019

I started spending some time thinking about this and wanted to track this. Have you guys thought of a design on how you guys want this to work? I was thinking of looking into GRPC and taking it and molding it into something that is memory efficient for TTRPC. Was there anything I should look out for?

I also noticed there isn't any use of a transport which seems necessary for stream handling. What was the plan to handle multiplexing on a given stream? net.Conn is used to handle reading and writing data. In GRPC eventually the connection is used to create a transport. However, I do not see any logic surrounding transport in the package. Was this intentionally left out or was there plans to add it later?

Is there any other feature that needs to be implemented to support this?

@stevvooe
Copy link
Member

So, we do have a transport that manages streams. The channeling protocol is defined in https://github.com/containerd/ttrpc/blob/master/channel.go#L44. It is roughly equivalent to what http/2 provides, minus the required server-side state management. The main complexity is simply managing the active streams. It shouldn't be too hard to add streaming support on top of that. I'd recommend studying how GRPC maps streaming requests to streams and work from there. In general, I would avoid using their code, as it is extremely inefficient and complex.

The protocol for GRPC is defined in https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md. I suspect that you might need to add some flags for ending streams to make it work but it may be as easy as just continuing to use the same stream id for the message passing on a streaming call.

@rcash
Copy link

rcash commented Oct 24, 2019

Hi @stevvooe and @xibz I'm a student in UT Austin's Virtualization class, are you still looking for people to contribute to this? If so, could I get some more info about what would be needed to add streaming support?

@dmcgowan dmcgowan self-assigned this Feb 17, 2022
@dmcgowan dmcgowan added this to the 1.7 milestone Feb 17, 2022
@dmcgowan
Copy link
Member

Merged in #107 , see new protocol doc for updates to protocol https://github.com/containerd/ttrpc/blob/main/PROTOCOL.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants