【メモ】【akka 2.3】Props
Props
Props is a configuration class to specify options for the creation of actors, think of it as an immutable and thus freely shareable recipe for creating an actor including associated deployment information (e.g. which dispatcher to use, see more below). Here are some examples of how to create a Props instance.
import akka.actor.Props val props1 = Props[MyActor] val props3 = Props(classOf[ActorWithArgs], "arg")
The last line shows how to pass constructor arguments to the Actor being created. The presence of a matching constructor is verified during construction of the Props object, resulting in an IllegalArgumentEception if no or multiple matching constructors are found.
Propsは設定のクラスである。
Props(classOf[ActorWithArgs], "arg") でコンストラクタに引数を渡す方法を示している。
ダメだったら IllegalArgumentExceptionを返す。
- 作者: Jamie Allen
- 出版社/メーカー: O'Reilly Media
- 発売日: 2013/08/15
- メディア: Kindle版
- この商品を含むブログを見る