

通过dubbo-compiler的插件生成了接口，会自动生成xxxAsync()方法，但是它只是通过CompletableFuture.completedFuture()包装了同步方法，它仍然会阻塞consumer的业务线程。这么实现的目的是什么？

![image](https://user-images.githubusercontent.com/18373569/216303859-4c8fe6e5-428b-417c-baa5-df4aa444719c.png)

![image](https://user-images.githubusercontent.com/18373569/216304057-e564e268-14e6-40e3-8244-7380fd9c9c85.png)


## Ask your question here
我当前使用dubbo 3.1.4的triple协议(同时使用了IDL+protobuf)，想提供CompletableFuture<Result>返回值的异步调用，应该怎么做？

客户端如果不使用proxy=“nativestub”，会抛出以下错误：

This serialization only support google protobuf messages, but the actual input type is :java.util.concurrent.CompletableFuture

客户端如果使用proxy=“nativestub”，调用kickOffDeviceAsync(),实际上会调用CompletableFuture.completedFuture(kickOffDevice(request));.如此就会造成阻塞了，没有达到异步的目的





* limitations under the License.
 */
package org.apache.dubbo.rpc.protocol.tri;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.ParameterizedType;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.serialize.MultipleSerialization;
import org.apache.dubbo.common.serialize.support.DefaultSerializationSelector;
import org.apache.dubbo.common.stream.StreamObserver;
import org.apache.dubbo.common.utils.ClassUtils;
import org.apache.dubbo.config.Constants;
import org.apache.dubbo.rpc.model.MethodDescriptor;
import org.apache.dubbo.rpc.model.PackableMethod;
import com.google.protobuf.Message;
import static org.apache.dubbo.common.constants.CommonConstants.$ECHO;
import static org.apache.dubbo.common.constants.CommonConstants.PROTOBUF_MESSAGE_CLASS_NAME;
import static org.apache.dubbo.remoting.Constants.SERIALIZATION_KEY;
import static org.apache.dubbo.rpc.protocol.tri.TripleProtocol.METHOD_ATTR_PACK;
public class ReflectionPackableMethod implements PackableMethod {
    private static final String GRPC_ASYNC_RETURN_CLASS = "com.google.common.util.concurrent.ListenableFuture";
    private static final String TRI_ASYNC_RETURN_CLASS = "java.util.concurrent.CompletableFuture";
    private static final String REACTOR_RETURN_CLASS = "reactor.core.publisher.Mono";
    private static final String RX_RETURN_CLASS = "io.reactivex.Single";
    private static final String GRPC_STREAM_CLASS = "io.grpc.stub.StreamObserver";