Bidirectional streaming with GRPC

The main advantage of GRPC over traditional HTTP/1.1 is that it uses a single TCP connection for sending and receiving multiple messages between the server and the client. We saw the example of a money transaction before. Another real-world use case is a GPS installed in a taxi. Here, the taxi is the client that sends its geographical points to the server along its route. Finally, the server can calculate the total fare amount depending on the time spent between points and the total distance. 

Another such use case is when a server needs to notify the client whenever some processing is performed. This is called a server push model. The server can send a stream of results back when a client asked for them ...

Get Building RESTful Web services with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.