Sphereとともに

scalaとかplayframeworkとか。技術ブログにしたいなと。環境は Windows7x64, mac です。たまに声優さん情報が混ざります。最近ちょっとClojure触りました。

【メモ】【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を返す。


Effective Akka

Effective Akka