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

Makes ResponseStream actually implement ReceiveChannel #217

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

jhump
Copy link
Member

@jhump jhump commented Feb 6, 2024

This is a small extension on top of the previous PR (#213).

Instead of response streams having a messages property of type ReceiveChannel, the ResponseStream interface extends ReceiveChannel. This just removes a small amount of indirection, hopefully making it easier to use.

This also makes ClientStream extend RequestStream, since its interface is a strict superset.

Finally, for the use case described by @kohenkatz in that previous PR, about possibly using channels as the way to get data into the request stream, this adds copyFromChannel helper functions for client- and bidi-streaming methods.

of containing a property of type ReceiveChannel.
Also makes ClientStream extend RequestStream.
Adds copyFromChannel helpers, to make it easier to use channels
as sources of request data for client- and bidi-streaming RPCs.
@jhump jhump merged commit c6e55d3 into main Feb 6, 2024
8 checks passed
@jhump jhump deleted the jh/response-streams-implement-receive-channel branch February 6, 2024 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants