question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CompletableFuture stubs

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:22
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
rmichelacommented, Mar 7, 2017

I get the impression from #2688 that Guava upgrades are problematic. Would Guava vNext introduce the same compatibility break that Guava 20 introduced?

1reaction
silospencommented, Aug 2, 2022

@ejona86 Can you help me understand the current state of CompletableFuture support in GRPC now that Java 7 looks to have been removed (congrats, btw, that’s a big deal!)?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CompletableFuture (Java Platform SE 8 ) - Oracle Help Center
Returns a new CompletableFuture that is completed when this CompletableFuture completes, with the result of the given function of the exception triggering this ......
Read more >
Mock CompletableFuture in spock - java - Stack Overflow
i trying create stub or mock for CompletableFuture in spock. My method is called async and return CompletableFuture. In spock method always ...
Read more >
CompletableFuture - Android Developers
CompletableFuture also implements Future with the following policies: ... Returns a new CompletableFuture that is completed when all of the given ...
Read more >
Effective Use of Java CompletableFuture Timeouts and join ...
This video walks through a pair of examples that demonstrate how to effectively use Java CompletableFuture timeouts and join() Mechanisms.
Read more >
WorkflowStub (cadence-client 2.4.0 API) - Javadoc.io
WorkflowStub is a client side stub to a single workflow instance. ... CompletableFuture<R>, getResultAsync(long timeout, java.util.concurrent.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found