These are chat archives for akkadotnet/akka.net

3rd
Jul 2016
Christian Sparre
@christiansparre
Jul 03 2016 09:44
In the TestKit, is there a reason why Sys.Stop() does not work on a test probe? If I do it on one of my own actors it works. But not on a test probe...
Or I don't know if it does not work, but anyone that watches the test probe does not receive a Terminated message..
Bartosz Sypytkowski
@Horusiath
Jul 03 2016 14:04
@christiansparre how are you invoking it?
Christian Sparre
@christiansparre
Jul 03 2016 14:36
var a = CreateTestProbe(); Sys.Stop(a);
Pretty much doing the "Monitor actor termination with Watch()" section of https://petabridge.com/blog/how-to-unit-test-akkadotnet-actors-akka-testkit/
Ryan Smith
@PrintsCharming
Jul 03 2016 16:05
Is there a method for outputting all existing actor instance paths? I'm thinking like graphing all the actors in a system.
Bartosz Sypytkowski
@Horusiath
Jul 03 2016 17:17
@christiansparre use watch and stop on actor ref rather than probe itself. Try something like this:
var a = CreateTestProbe();
Watch(a.Ref);
Sys.Stop(a.Ref);
a.ExpectTerminated();

@PrintsCharming you can call all actors to identify themselves. You need to create actor selection referring to each actor in current actor system and then send Identify method to it, i.e.:

var all = Context.ActorSelection("/user/**/*");
all.Tell(new Identify(null));

Then each actor will send ActorIdentity message as a response to an actor which had sent Identify message.

Christian Sparre
@christiansparre
Jul 03 2016 17:30
@Horusiath thanks, that makes sense. Didn't think of the fact that the probe it self is not a true IActorRef ☺