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.

grpc on react-native server-side streaming RPCs (1 request N responses) only send response on close

See original GitHub issue

Versions of relevant software used grpc-web v0.14.0

What happened GRPC stream requests made through React Native do not respond until the stream is closed.

What you expected to happen GRPC stream messages to be processed as they are received.

How to reproduce it (as minimally and precisely as possible): Add a sleep after stream.Send I added 5 seconds here. func (s *bookService) QueryBooks(bookQuery *pb_library.QueryBooksRequest, stream pb_library.BookService_QueryBooksServer) error { for _, book := range s.books { if strings.HasPrefix(s.book.Author, bookQuery.AuthorPrefix) { stream.Send(book) time.Sleep(time.Second * 5) } } return nil }

All books will only be received when the stream closes.

Tested this in the browser and messages are received as the server sends them. Full logs to relevant components

Environment:

  • OS (e.g. from /etc/os-release): Android / React Native –>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
HappyRainycommented, Feb 10, 2022

We have the same issue for our server side streaming grpc service. Really hope it can be solved.

0reactions
leolusolicommented, Apr 14, 2022

+1

This is an huge issue. In this current moment, the library is not usable for handle streams inside a react-native project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

grpc on react-native server-side streaming RPCs (1 request N ...
GRPC stream requests made through React Native do not respond until the stream is closed. What you expected to happen. GRPC stream messages...
Read more >
Tutorial on gRPC streams with Golang and React. - ITNEXT
The tutorial covers how to use gRPC streams in Golang and React. ... a connection with one request and then wait for data...
Read more >
Building a realtime dashboard with ReactJS, Go, gRPC, and ...
gPRC allows you to communicate in multiple methods. Unary RPC. Client sends a request and gets a response back from the server (...
Read more >
Basics tutorial | Node - gRPC
A server-side streaming RPC where the client sends a request to the server and gets a stream to read a sequence of messages...
Read more >
The Mysterious Gotcha of gRPC Stream Performance | Ably Blog
gRPC was developed by Google as an open source Remote Procedure Call (RPC) framework designed to connect services in and across data centers....
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