-
Notifications
You must be signed in to change notification settings - Fork 826
服务端业务层支持异步返回 #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
服务端业务层支持异步返回 #173
Conversation
@wood001 感谢你的提交, 这里有一个错误和你的提交有关,还需要你看一下。
|
@wood001 能留一下你的联系方式吗? 有关异步处理的事情我们还需沟通一下。 |
SwaggerConsumerOperation consumerOperation = swaggerConsumer.findOperation(method.getName()); | ||
consumerOperation.getArgumentsMapper().toInvocation(args, invocation); | ||
|
||
Response response = InvokerUtils.innerSyncInvoke(invocation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the sync invocation, I think this part change is only for supporting the return type signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,这次修改的代码重点关注在了服务端,consumer侧只是为了能够兼容服务端的接口做了下适配。
这次提交主要是用来讨论下方案,如果方案可以,我可以重新修改代码,实现完应用层服务端和客户端的异步能力。
|
||
ConsumerArgumentsMapper argsMapper = | ||
consumerArgumentsFactory.createArgumentsMapper(swaggerMethod, consumerMethod); | ||
Type producerMethodReturnType = consumerMethod.getGenericReturnType(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be better if we can extract a method here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,对于异步返回的类型检查可以提供一个公共的方法。
@WillemJiang 但是通过业务层接口增加hystrix注解简化应用层实现异步的能力确实是个很好的实践,我来考虑下结合hystrix注解实现真实的异步,同时consumer侧也真实支持异步能力。 稍后我会重新PR |
#155 关于服务端和客户提供异步调用的能力