Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 1.49 KB

L25-cpp-expose-buffer-reader-writer.md

File metadata and controls

27 lines (18 loc) · 1.49 KB

L25: [C++] Make GrpcProtoBuffer{Reader|Writer} Public

Abstract

We propose to move two classes, GrpcProtoBufferWriter and GrpcProtoBufferReader, to a public directory, so that users may create custom serialization traits without having to "reinvent the wheel".

Background

We have seen several user complaints that creating custom serializers is not an easy task. For example, TensorFlow duplicated an internal file, which led to a nasty bug. Another project had to use a hacky workaround to subtype the GrpcProtoBuffer{Reader|Writer} classes in order to implement a zero copy serializer.

Related Proposals:

  • This relates to L26, in that it is making it easier to customize serialization code.

Proposal

We will rewrite GrpcProtoBuffer{Reader|Writer} in terms of the public class, grpc::ByteBuffer. Then we will move GrpcProtoBuffer{Reader|Writer} out of the internal namespace, and add header files in include/grpcpp/support so that the classes become accessible.

Implementation

Implementation is in #14541