Skip to content

Commit

Permalink
fix apache#6555, backward compatibility: com.alibaba.dubbo.rpc.protoc…
Browse files Browse the repository at this point in the history
…ol.dubbo.FutureAdapter missing constructor. (apache#6675)
  • Loading branch information
chickenlj authored Sep 1, 2020
1 parent 611be16 commit e952d8e
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ public FutureAdapter(CompletableFuture<Object> future) {
this.future = future;
}

public FutureAdapter(ResponseFuture responseFuture) {
this.future = new CompletableFuture<>();
responseFuture.setCallback(new ResponseCallback() {
@Override
public void done(Object response) {
future.complete(response);
}

@Override
public void caught(Throwable exception) {
future.completeExceptionally(exception);
}
});
}

public ResponseFuture getFuture() {
return new ResponseFuture() {
@Override
Expand Down

0 comments on commit e952d8e

Please sign in to comment.