dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

Add dobbu util support for async callable feature.

Open khanimteyaz opened this issue 7 years ago • 3 comments

Come up with some design and implementation for dubbo util support. The purpose of this enhancement is to provide utility methods which can help dubbo user to use and achieve the better API experience without enforcing service implementation to provide those support while they write service.

e.g. If consumer of service needs to make a Future type of call then instead of service implementation can add those as feature, using Dubbo provided utility they can transfer Rpc call to future callable using something like

RpcFuture future=DubboRpcUti.toFuture(someService.someMethod(msg),someNotifyMethod);

DubboRpcUril.call(someUserService.getUser(org)).process(businessLogicMethod).onException(UserNotAvailable.class,handleUserNotAvailable)

Above are not exhaustive list or final, but the idea is this is an place holder for coming up with some approach, design and implementation.

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.
  • [ ] I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: xxx
  • Operating System version: xxx
  • Java version: xxx

Steps to reproduce this issue

  1. xxx
  2. xxx
  3. xxx

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Actual Result

What actually happens?

If there is an exception, please attach the exception trace:

Just put your stack trace here!

khanimteyaz avatar Jan 02 '19 07:01 khanimteyaz

On it.

khanimteyaz avatar Jan 02 '19 07:01 khanimteyaz

Hi, Here's few API targeting the same purpose for reference. It's a little out-dated and hard to use.

https://github.com/apache/incubator-dubbo/blob/460c3a17568ff31f994646558a48c2d0e7b37bd4/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcContext.java#L659

chickenlj avatar Jan 10 '19 08:01 chickenlj

Hi, Here's few API targeting the same purpose for reference. It's a little out-dated and hard to use.

incubator-dubbo/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/RpcContext.java

Line 659 in 460c3a1

public CompletableFuture asyncCall(Callable callable) {

Thanks for sharing this. As this week onward my works be less than last two week, hopefully will be able to work on this.

khanimteyaz avatar Jan 19 '19 16:01 khanimteyaz