cagri.ozer@outlook.com
Senior Software Developer @ Coolblue
Protobuf and gRPC
an intorduction
Çağrı Özer
Senior Software Developer @ Coolblue
What is it?
Protocol Buffers are a cross-platform language-agnostic standard for serializing and deserializing structured data.
What does that mean?
What is it?
Yapılı datayı serileştirmek için bir yöntem
Xml gibi, ama;
Mesajların insan okunabilir olmasının önemli olmadığı, paket boyutunu ile hızın kritik olduğu ve son kullanıcının tarayıcı olmadığı senaryolar
Şu anda desteklenen diller: Java, Python, Objective-C, C++, Go, JavaNano, Ruby, C#
protoc --proto_path=. --csharp_out . .\addressbook.proto
Google'ın protobuf mimarisi üzerine kurduğu bir servis framework.
service PhoneBookService
{
rpc AddPerson(Person) returns (AddPersonReply) {}
rpc GetPhoneBook(Empty) returns(AddressBook) {}
}
protoc --proto_path=. --csharp_out .\AddressBook.Core\ --grpc_out .\AddressBook.Core\ .\addressbook.proto
--plugin=protoc-gen-grpc=grpc_csharp_plugin.exe
rpc GetPerson(GetPersonRequest) returns (Person) {}
rpc GetPersonBiography(GetPersonRequest) returns (stream Biography) {}
rpc SavePersonBiography(stream biography) returns (StatusReply) {}
rpc GramarCheck(stream Text) returns (stream Text) {}
By cagri.ozer@outlook.com