proposal/L25-cpp-expose-buffer-reade...

1.5 KiB

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.

  • 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