DEV Community

Discussion on: A beginners guide to gRPC with Rust

Collapse
 
vixorem profile image
Victor • Edited

HI! I'm having a trouble with streaming. I cloned your repo and ran server and cient. I tried function send_stream but modified it putting sleep(4 second) for each iteration in the spawned task. When I ran client I was expecting a short delay between messages I receive from the server but it worked differently. The delay took about 20 seconds without any incoming messages (4 iterations with 4 sleeps per eacn) and then I got all the messages at the moment. Why does it happen and how can I make streaming send and receive in time?

Collapse
 
vixorem profile image
Victor

I've set channel buffer size to 1 and it seems to be working but I don't undestand why