grpc / grpc/grpc-java

CompletableFuture stubs

Open
#2,797 10 comments 27 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

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.
1. Implement `CompletableFuture`-based stubs inline with the existing generated stubs by adding `@@protoc_insertion_point`s 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.
1. 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.