grpc / grpc-dart

The Dart language implementation of gRPC.
https://pub.dev/packages/grpc
Apache License 2.0
835 stars 256 forks source link

Support .map() that returns ResponseStream instead of Stream #689

Open maherjaafar opened 5 months ago

maherjaafar commented 5 months ago
keeping the return type as `ReponseStream` to be able to call **.cancel()** after using `.map()` Used version: `grpc: 3.2.4` ## Example ``` final myStream = _client .myReponseStream .listen((event) => event.map((event) => event.value)); ``` Expected result: I expect to get result of type `ReponseStream` but the result will be of type `Stream` Actual result: `Stream`
maherjaafar commented 4 months ago

Any updates?

maherjaafar commented 2 months ago

@mosuem any updates?

mosuem commented 2 months ago

Hi @maherjaafar, I am not sure what you mean. Where does this WatchEventsRequest come from?

maherjaafar commented 1 month ago

@mosuem It's just an example. I changed it⬆️

The issue arises when I use .map, as it converts it to a Stream instead of a ResponseStream. Consequently, I lose the ability to call myResponseStream.cancel() to cancel the stream.