trait Creators extends AnyRef
- Alphabetic
- By Inheritance
- Creators
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Act
extends Actor
This trait provides a DSL for writing the inner workings of an actor, e.g.
This trait provides a DSL for writing the inner workings of an actor, e.g. for quickly trying things out in the REPL. It makes the following keywords available:
become
mapped tocontext.become(_, discardOld = true)
becomeStacked
mapped tocontext.become(_, discardOld = false)
unbecome
mapped tocontext.unbecome
setup
for implementingpreStart()
whenFailing
for implementingpreRestart()
whenRestarted
for implementingpostRestart()
teardown
for implementingpostStop
Using the life-cycle keywords multiple times results in replacing the content of the respective hook.
-
trait
ActWithStash
extends ActorDSL.Act with Stash
Use this trait when defining an akka.actor.Actor with akka.actor.Stash, since just using
actor()(new Act with Stash{})
will not be able to see the Stash component due to type erasure.
Value Members
-
def
actor[T <: Actor](factory: ActorRefFactory)(ctor: ⇒ T)(implicit arg0: ClassTag[T]): ActorRef
Create an actor with an automatically generated name from the given thunk which must produce an akka.actor.Actor.
Create an actor with an automatically generated name from the given thunk which must produce an akka.actor.Actor.
- factory
is an implicit akka.actor.ActorRefFactory, which can either be an akka.actor.ActorSystem or an akka.actor.ActorContext, where the latter is always implicitly available within an akka.actor.Actor.
- ctor
is a by-name argument which captures an akka.actor.Actor factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.
-
def
actor[T <: Actor](factory: ActorRefFactory, name: String)(ctor: ⇒ T)(implicit arg0: ClassTag[T]): ActorRef
Create an actor from the given thunk which must produce an akka.actor.Actor.
Create an actor from the given thunk which must produce an akka.actor.Actor.
- factory
is an implicit akka.actor.ActorRefFactory, which can either be an akka.actor.ActorSystem or an akka.actor.ActorContext, where the latter is always implicitly available within an akka.actor.Actor.
- name
is the name, which must be unique within the context of its parent; defaults to
null
which will assign a name automatically.- ctor
is a by-name argument which captures an akka.actor.Actor factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.
-
def
actor[T <: Actor](name: String)(ctor: ⇒ T)(implicit arg0: ClassTag[T], factory: ActorRefFactory): ActorRef
Create an actor from the given thunk which must produce an akka.actor.Actor.
Create an actor from the given thunk which must produce an akka.actor.Actor.
- name
is the name, which must be unique within the context of its parent.
- ctor
is a by-name argument which captures an akka.actor.Actor factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.
- factory
is an implicit akka.actor.ActorRefFactory, which can either be an akka.actor.ActorSystem or an akka.actor.ActorContext, where the latter is always implicitly available within an akka.actor.Actor.
-
def
actor[T <: Actor](ctor: ⇒ T)(implicit arg0: ClassTag[T], factory: ActorRefFactory): ActorRef
Create an actor from the given thunk which must produce an akka.actor.Actor.
Create an actor from the given thunk which must produce an akka.actor.Actor.
- ctor
is a by-name argument which captures an akka.actor.Actor factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.
- factory
is an implicit akka.actor.ActorRefFactory, which can either be an akka.actor.ActorSystem or an akka.actor.ActorContext, where the latter is always implicitly available within an akka.actor.Actor.