Stream data callback not called till after last stream element sent
See original GitHub issueI’m calling a grpc function with a stream response as shown in the serverStreamingEcho()
example in the README, but even though the server sends a stream element every 1/2 second, my stream.on('data', ...)
callback doesn’t get called until after the whole stream has been sent down (then it gets called for each element). So it’s not actually “streaming”. I’m using the Envoy grpc-web filter.
Is there a special request header that needs to be sent or something else that needs to be done to get streaming to work? Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
callback to handle completion of pipe - node.js - Stack Overflow
Streams are EventEmitter s so you can listen to certain events. As you said there is a finish event for request (previously end...
Read more >Stream | Node.js v19.3.0 Documentation
If the consumer of the Stream does not call stream.read() , the data will sit in the internal queue until it is consumed....
Read more >Asynchronous programming: Streams | Dart
Streams are done when there are no more events in them, and the code receiving the events is notified of this just as...
Read more >Understanding the Event Loop, Callbacks, Promises, and ...
You want to work with the data from the API call, but you have to make sure the data is returned first. The...
Read more >Top 10 Most Common Node.js Developer Mistakes - Toptal
One common Node.js issue related to using callbacks is calling them more than once. ... statement every time “done” is called, up until...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Also just as a guess, when you run the
protoc-gen-grpc-web
plugin, did you pass inmode=grpcwebtext
? If you had passed inmode=grpcweb
streaming won’t work, yet.Got it, helpful to know that this won’t be coming soon. Thanks for your help, closing this ticket.