fullstorydev / grpcurl

Like cURL, but for gRPC: Command-line tool for interacting with gRPC servers
MIT License
10.36k stars 497 forks source link

Feature request: exit stream successfully after receiving N responses #410

Open jtylka opened 10 months ago

jtylka commented 10 months ago

hi, I'm trying to use gRPCurl in some automated API test suite, and I'm not sure what the best way to test response-streaming RPC methods. I would like to call the method, make sure the stream starts, and then gracefully cancel the stream with a success code (assuming everything actually works until that point).

so far, what I've found is the flag -max-time, which limits how long gRPCurl is subscribed to the stream, but then it closes with an ERROR:

  Code: DeadlineExceeded
  Message: Deadline Exceeded

would it be possible to add an option like -max-response N, which only applies to response-streaming RPCs, and then cancels the stream gracefully once the desired number of responses has been received by gRPCurl?

thanks!