question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stream data callback not called till after last stream element sent

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
stanley-cheungcommented, Sep 6, 2018

Also just as a guess, when you run the protoc-gen-grpc-web plugin, did you pass in mode=grpcwebtext? If you had passed in mode=grpcweb streaming won’t work, yet.

0reactions
ctoomeycommented, Sep 7, 2018

Got it, helpful to know that this won’t be coming soon. Thanks for your help, closing this ticket.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found