Last active
August 29, 2015 14:17
-
-
Save stefansedich/0c5e1d2ac431eccd9fed to your computer and use it in GitHub Desktop.
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
public class ParentActor : ReceiveActor { | |
private ActorRef _child; | |
public ParentActor() { | |
_child = Context.ActorOf<Child>(); | |
Receive<Start>(m => { | |
_child.Tell(new Child.Start{State = 123})); | |
}); | |
} | |
public class Start { | |
} | |
} | |
public class ChildActor : ReceiveActor { | |
private Something _someState; | |
public ChildActor() { | |
Receive<Start>(m => { | |
_someState = new Something(m.State); | |
Self.Tell(new DoStuff()); | |
}); | |
Receive<DoStuff>(m => { | |
_someState.Read(); // This could fail | |
Self.Tell(new DoStuff()); | |
}); | |
} | |
public class Start { | |
public int State { get;set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment