feign icon indicating copy to clipboard operation
feign copied to clipboard

Client and AsyncClient abstraction seems not good enough

Open MicroKernelArt opened this issue 3 years ago • 1 comments

  1. we expose much implemention detail to user api , user must identify the sync feign client/builder and the async client/buider. If we only expose client to user , and proxy sync/async method accordingly(seperate/implement the async boundary accordingly), is it feasible?

2.sync invoke or async invoke seems is naturally unified, could we just Override accordingly?

public interface Client { 

default Response execute(Request request, Options options) throws IOException {
      return execute(request, options, emptyContext).join(); 
}

default CompletableFuture<Response> execute(Request request, Options options, Optional<C> requestContext){
  return CompletableFuture.completed(execute(request, options));
}

}

MicroKernelArt avatar May 19 '21 03:05 MicroKernelArt

good point, that could be an alternative way of implementing this....

IIRC, all async work is marked as experiment, so you could raise a PR with this changes for us to take a look.

velo avatar May 19 '21 04:05 velo