我的应用程序中有一个控制器使用Play Framework, val someval = callToService() val somerandomobject = new SomeRandomObject() call to webservice which returns futurethe values in somerandomobject as per the response. so
使用EitherT[Future, A, B]完成许多操作。有时,我希望通过另一个具有签名A => Future[C]的操作来映射左或右。另一种情况是,EitherT[Future, A, B]是对未来结果Future[EitherT[Future, A, B]]进行映射的结果。我怎样才能优雅地扁平类型,比如:
EitherT[Future, Fut
我的问题是,使用Future.successful或Future.failed是否会跳过这个请求到线程池。性能影响对于正确使用未来是很重要的。通过创建一个已经完成的未来,这两个编程结构是否避免从线程池请求线程?具体而言,让我们比较两个代码块:val fut = Future(1+1)b)通过不访问线程