GopherCon 2017: grpc: From Tutorial to Production - Alan Shreve

preview_player
Показать описание
grpc has become the best-in-class toolkit for inter-service communication. We'll take a crash course by iteratively evolving the Go tutorial code to address the advanced concerns of deploying grpc in production including monitoring, balancing, errors, timeouts + more while drawing on lessons learned from 2 years of production experience running ngrok's infrastructure with grpc.
Рекомендации по теме
Комментарии
Автор

alan you talked about custom error handling not being easy with grpc . If we consider:

message Data(define here the actual data that would be in the response for successful call)

message Error (
string name=1 ; //could store the attribute that cause the error
string message=2 ; //the actual description of the error
)

And finally

message Response (
Data data=1;
repeated Error error=2;
)

Wouldn't it fit the purpose and be pretty flexible ? We then check if grpc error code is not nil and check for errors descriptions if any, else consider the default error message matching the error code

lahssenkh
Автор

"Never have to write another REST Client Library". YA BUDDY NEVER GONNA HAPPEN. By the way I used GRPC. Documentation is really poor so if you guys want people to use it. Improve the documentation!

mohitshah