内容简介:ScalaFutures完成的轮询是通过调度程序完成的(afaik);因此,它不会阻止任何线程.因此,您可能会有许多并发运行的测试,这些测试远远超过了测试实际运行的ExecutionContext上可用的线程.翻译自:https://stackoverflow.com/questions/27319697/advantages-of-using-scalafutures-from-scalatest-vs-await-result
Futures与测试中的Await.result的使用或whenReady或.futureValue进行了讨论.除了可读性,使用whenReady时配置(超时)和结果范围的一致性,使用ScalaFutures方法比Await.result还有其他明显的优势吗?
我注意到ScalaFutures使用“轮询”技术而不是像Await一样阻止,但有人可以详细说明优势吗?
ScalaFutures完成的轮询是通过调度程序完成的(afaik);因此,它不会阻止任何线程.因此,您可能会有许多并发运行的测试,这些测试远远超过了测试实际运行的ExecutionContext上可用的线程.
翻译自:https://stackoverflow.com/questions/27319697/advantages-of-using-scalafutures-from-scalatest-vs-await-result
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
An Introduction to the Analysis of Algorithms
Robert Sedgewick、Philippe Flajolet / Addison-Wesley Professional / 1995-12-10 / CAD 67.99
This book is a thorough overview of the primary techniques and models used in the mathematical analysis of algorithms. The first half of the book draws upon classical mathematical material from discre......一起来看看 《An Introduction to the Analysis of Algorithms》 这本书的介绍吧!