Package akka.actor.dsl
Interface Creators
-
- All Known Implementing Classes:
ActorDSL$
public interface Creators
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Creators.Act
static interface
Creators.ActWithStash
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Actor>
ActorRefactor(ActorRefFactory factory, java.lang.String name, scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$3)
Create an actor from the given thunk which must produce anActor
.<T extends Actor>
ActorRefactor(ActorRefFactory factory, scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$4)
Create an actor with an automatically generated name from the given thunk which must produce anActor
.<T extends Actor>
ActorRefactor(java.lang.String name, scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$2, ActorRefFactory factory)
Create an actor from the given thunk which must produce anActor
.<T extends Actor>
ActorRefactor(scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$1, ActorRefFactory factory)
Create an actor from the given thunk which must produce anActor
.Props
mkProps(java.lang.Class<?> classOfActor, scala.Function0<Actor> ctor)
-
-
-
Method Detail
-
actor
<T extends Actor> ActorRef actor(scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$1, ActorRefFactory factory)
Create an actor from the given thunk which must produce anActor
.- Parameters:
ctor
- is a by-name argument which captures anActor
factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.factory
- is an implicitActorRefFactory
, which can either be anActorSystem
or anActorContext
, where the latter is always implicitly available within anActor
.evidence$1
- (undocumented)- Returns:
- (undocumented)
-
actor
<T extends Actor> ActorRef actor(java.lang.String name, scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$2, ActorRefFactory factory)
Create an actor from the given thunk which must produce anActor
.- Parameters:
name
- is the name, which must be unique within the context of its parent.ctor
- is a by-name argument which captures anActor
factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.factory
- is an implicitActorRefFactory
, which can either be anActorSystem
or anActorContext
, where the latter is always implicitly available within anActor
.evidence$2
- (undocumented)- Returns:
- (undocumented)
-
actor
<T extends Actor> ActorRef actor(ActorRefFactory factory, java.lang.String name, scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$3)
Create an actor from the given thunk which must produce anActor
.- Parameters:
name
- is the name, which must be unique within the context of its parent; defaults tonull
which will assign a name automatically.ctor
- is a by-name argument which captures anActor
factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.factory
- is an implicitActorRefFactory
, which can either be anActorSystem
or anActorContext
, where the latter is always implicitly available within anActor
.evidence$3
- (undocumented)- Returns:
- (undocumented)
-
actor
<T extends Actor> ActorRef actor(ActorRefFactory factory, scala.Function0<T> ctor, scala.reflect.ClassTag<T> evidence$4)
Create an actor with an automatically generated name from the given thunk which must produce anActor
.- Parameters:
ctor
- is a by-name argument which captures anActor
factory; do not make the generated object accessible to code outside and do not return the same object upon subsequent invocations.factory
- is an implicitActorRefFactory
, which can either be anActorSystem
or anActorContext
, where the latter is always implicitly available within anActor
.evidence$4
- (undocumented)- Returns:
- (undocumented)
-
-