feign
feign copied to clipboard
Client and AsyncClient abstraction seems not good enough
- 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));
}
}
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.