You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/07/14 03:09:33 UTC

[GitHub] [servicecomb-java-chassis] johnyannj opened a new issue #1883: 建议异步编程支持project-reactor

johnyannj opened a new issue #1883:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1883


   建议异步编程支持project-reactor
   
   类似webflux。
   
   因为CompletableFuture太难用了~~


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #1883: 建议异步编程支持project-reactor

Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #1883:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1883#issuecomment-738512233


   暂时没有这个计划。 CompletableFuture 目前看依然非常好用,只是开发者还没习惯, 而且 JDK  的后续版本异步编程还在持续增强,大部分开发者对异步的诉求也不是很强烈。 java-chassis 保持和 JDK 一致, 暂时不会考虑使用第三方开发接口做异步。 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #1883: 建议异步编程支持project-reactor

Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #1883:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1883#issuecomment-738515304


   可以说一下有哪些地方“太难用”不  
     
   我目前知道的有一个点:通过async系列方法切换线程后,后续没指定线程池的then/when调用挂上去的回调,执行线程是不确定的  
   这个问题我是在java 11里,通过继承CompletableFuture搞定的(在java 8里不太好搞)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] johnyannj commented on issue #1883: 建议异步编程支持project-reactor

Posted by GitBox <gi...@apache.org>.
johnyannj commented on issue #1883:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1883#issuecomment-740338232


   @wujimin
   
   CompletableFuture不是标准的响应式编程规范Reactive-stream-API
   stream的API使用很广泛,很容易入门。
   CompletableFuture是自搞一套,javadoc也不如project-reactor。而且CompletableFuture不支持lazy启动。
   
   而且project-reactor是Spring官方支持的, 有比CompletableFuture更丰富的第三方支持。
   
   举个例子servicecomb使用的spring的AsyncRestTemplate,spring 5里就废弃了,建议使用project reactor接口的webclient


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] wujimin commented on issue #1883: 建议异步编程支持project-reactor

Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #1883:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1883#issuecomment-740345048


   确实lazy是最大的问题,我上面说的执行线程的问题,就跟这个有关   
   不过,除此之外,jdk的这个CompletableFuture,还是很好用的  
   我在做的服务项目中,consumer都是使用透明RPC开发模式,不需要像restTemplate/webClient一样,需要记忆url/参数名/参数类型等等信息,不存在不小心写错的可能性  
     
   在开发模式上,引入新的类型,应该可以考虑(目前各reactive封装都提供了与CompletableFuture的转换接口)  
   但是内部扩展点上,目前已经在基于jdk的CompletableFuture全面重构(https://issues.apache.org/jira/browse/SCB-1929#) ,可能不会切换了


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] xhanthow commented on issue #1883: 建议异步编程支持project-reactor

Posted by GitBox <gi...@apache.org>.
xhanthow commented on issue #1883:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1883#issuecomment-738554798


   我这个+1是指->异步编程支持`project-reactor`
   目前用这个`CompletableFuture`还是没遇到啥问题。


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] xhanthow commented on issue #1883: 建议异步编程支持project-reactor

Posted by GitBox <gi...@apache.org>.
xhanthow commented on issue #1883:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1883#issuecomment-737728963


   +1,有这个计划么~


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org