Last active
December 16, 2015 17:49
-
-
Save rkuhn/5472884 to your computer and use it in GitHub Desktop.
sample snippets for Props spotlight blogpost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ActorRef child = getContext().actorOf(new Props( | |
new UntypedActorFactory() { | |
@Override public UntypedActor create() { | |
// getSender() will not yield what you think it should | |
return new OtherActor(getSender()); | |
} | |
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// it is completely random what that actor’s constructor arg will be | |
val child = context.actorOf(Props(new OtherActor(sender))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ActorRef child = | |
getContext().actorOf(Props.create(OtherActor.class, getSender())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val child = context.actorOf(Props(classOf[OtherActor], sender)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment