ブロックプールを使用してブロックリクエストを作成しようとしています。 問題は、各リクエストがプール全体をブロックしており、アイテムが順番に処理されていることです。 これが可能であるかどうかは不明です。誰かがリクエストをブロックするためのAkkaアクタープール
city-dispatcher {
type = Dispatcher
executor = "thread-pool-executor"
thread-pool-executor {
fixed-pool-size = 16
}
throughput = 100
}
を助けてくださいとJava
Props props = Props.create(CityDataProcessorActor.class, psRespHolder).withDispatcher("akka.actor.city-dispatcher");
SmallestMailboxPool pool = new SmallestMailboxPool(10);
ActorRef cityRequestActorPool = actorSystem.actorOf(pool.props(props), "city-request-route");
for (String city : citiesArray) {
Future<Object> future = Patterns.ask(cityRequestActorPool, new CityCommand(city.trim()), timeout);
Object results = Await.result(future, duration);
log.info(results.toString());
}
'オブジェクトの結果= Await.result(将来、持続時間)、将来を試すことができます。 'for'ループは、結果が主張されるまで進まません。 –