Created
April 6, 2017 21:28
-
-
Save cpoDesign/0a5e33f21e18d585574a2125818ab83e to your computer and use it in GitHub Desktop.
Akka.NET PoisonPill
This file contains hidden or 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
// The fact that user actor is created using the props does not mean | |
// anything as it needs to be registered with the system to know about it. | |
Props demoActorRef = Props.Create<MyDemoActor>(); | |
// Lets register the actor with the system | |
IActorRef actorRef = BulkProcessingSystem.ActorOf(demoActorRef, "DemoActor"); | |
// Send message to the actor | |
actorRef.Tell("Akka.net rocks"); | |
// Step to kill the instance of the actor | |
actorRef.Tell(PoisonPill.Instance); | |
// Attempt to send message again => message will be undelivered unless something will pick it up | |
actorRef.Tell("Akka.net rocks after pill"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment