Skip to content

CompletableFuture stubs #2797

@rmichela

Description

@rmichela

Hello,
I'd like to start a discussion about adding a CompletableFuture-based stub implementations to gRPC. I understand that generated gRPC code must be backwards compatible with Java 6, so here are some alternative implementation strategies to consider.

  1. Implement CompletableFuture-based stubs in a stand-alone class generated by a stand-alone protoc plugin. The CF stub class would reference the public MethodDescriptors of the stock generated client. This option is easiest to implement, but presents a fragmented programming model.
  2. Implement CompletableFuture-based stubs inline with the existing generated stubs by adding @@protoc_insertion_points to the stock c++ generator. A protoc plugin would be used to populate the insertion points. This option has the benefit of presenting a homogenous programming model for this, and all future plugin-based stub extensions, but requires a coordinated one time change with the protoc project.
  3. Extend the c++ generator with optional support for CompletableFuture. Use a protoc flag to turn it on and off. Not a great option, but possible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions