2017-05-25 3 views
0

次のようにakkaを使ってjavaでアクターシステムを作成しました。また、私は監督の俳優を作成しました。親アクターコンテキストを使用してjava-akkaでカスタムディスパッチャーを割り当てる方法

最終ActorSystemシステム= getSystem()。 system.actorOf(Props.create(Supervisor.class)、Supervisor.NAME);

私は次のようにデフォルトのディスパッチャを更新しました。

akka { 
     default-dispatcher { 
     # Dispatcher is the name of the event-based dispatcher 
     type = Dispatcher 
     # What kind of ExecutionService to use 
     executor = "fork-join-executor" 
     # Configuration for the fork join pool 
     fork-join-executor { 
      # Min number of threads to cap factor-based parallelism number to 
      parallelism-min = 256 
      # Parallelism (threads) ... ceil(available processors * factor) 
      parallelism-factor = 40.0 
      # Max number of threads to cap factor-based parallelism number to 
      parallelism-max = 512 
     } 
     # Throughput defines the maximum number of messages to be 
     # processed per actor before the thread jumps to the next actor. 
     # Set to 1 for as fair as possible. 
     throughput = 1 
     } 
} 

問題は、特定の俳優向けのカスタムディスパッチャを書くときに直面する問題です。その中で、それはあなたがあなたの設定に「展開」セクションを追加する必要がある俳優

答えて

0

のパターンを認識しません。

コード:

ActorRef myActor = 
    system.actorOf(Props.create(MyActor.class), 
    "myactor"); 

設定:the documentation

akka.actor.deployment { 
    /myactor { 
    dispatcher = my-dispatcher 
    } 
} 

ルック

関連する問題