0
안에 Future
의 몇 가지 작업을 수행하고 있습니다. 대신 내 Future
에 대한 ExecutionContext.Implicits.global
를 사용스칼라 특성 내에서 application.conf에 정의 된 사용자 지정 디스패처에 액세스
trait MyTrait {
//Future based operations
}
, 내 application.conf
에 정의를 사용하고 싶습니다.
akka {
my-batch-dispatcher {
type = Dispatcher
executor = "fork-join-executor"
fork-join-executor {
parallelism-min = 10
parallelism-factor = 2.0
parallelism-max = 10
}
throughput = 20
}
}
내 액터 내에서 실행 컨텍스트를 얻기 위해 조회를 할 수 있습니다.
implicit val ec = context.system.dispatchers.lookup("akka.my-batch-dispatcher")
이제 내 특성 내에서이를 수행하는 방법을 확인하십시오.