protoc-gen-typescript-http icon indicating copy to clipboard operation
protoc-gen-typescript-http copied to clipboard

Server-side streaming support

Open aimuz opened this issue 2 years ago • 1 comments

grpc-gateway supports Server-side streaming.

Server-side streaming is also supported by fetch.

https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams

The current protoc-gen-typescript-http has problems with clients generated by Server-side streaming.

protoc-gen-typescript-http

export interface LoggingService {
  QueryLogs(request: QueryLogsRequest): Promise<QueryLogsResponse>;
}

service.proto

service LoggingService {
  rpc QueryLogs(QueryLogsRequest) returns (QueryLogsResponse) {
    option (google.api.http) = {
      get: "/v1beta1/{parent=projects/*}/logs:query"
    };
    option (google.api.method_signature) = "parent";
  }

  rpc TailLogs(TailLogsRequest) returns (stream TailLogsResponse) {
    option (google.api.http) = {
      get: "/v1beta1/{parent=projects/*}/logs:tail"
    };
    option (google.api.method_signature) = "parent";
  }
}

aimuz avatar May 29 '23 02:05 aimuz

This plugin does not yet support server-side streaming, as we have not had a use-case for it. If you feel up for adding that support, please go ahead!

ericwenn avatar May 29 '23 20:05 ericwenn