scala.concurrent.Future 대신 akka.http.scaladsl.util.FastFuture를 사용해야합니까?scala.concurrent.Future 대신 akka.http.scaladsl.util.FastFuture를 사용해야합니까?
코멘트는 말한다 : 나는 Future.apply
, Future.successful
또는 Future.failed
를 사용해야하는 경우에
/**
* Provides alternative implementations of the basic transformation operations defined on [[scala.concurrent.Future]],
* which try to avoid scheduling to an [[scala.concurrent.ExecutionContext]] if possible, i.e. if the given future
* value is already present.
*/
내가 특히 어떤 성능 향상을받을 수 있나요?
정확히 두 구현의 차이점은 무엇입니까?
차이점은 'FastFuture'에서 시작하여'map','filter' 등의 조합 메소드 중 하나를 호출하고 기본'Future'가 이미 완료 되었다면 결합 호출은 직접 실행됩니다 호출자 스택에. – jrudolph
이미 완료된 Future가 'Try'와 매우 유사하다고 말할 수 있습니다. 여전히 계류중인'Future'의 경우, 그것은'Future'와 같은 것입니다 : 모든 combinator 호출은 암묵적으로 전달 된'ExecuteContext'를 사용하여 실행될 것입니다. – jrudolph
왜 변경 사항이'scala.concurrent.Future'에 병합되지 않습니까? –