/// <summary> /// Parses hocon configuration of actor system and starts <seealso cref="NameSpaceActor"/> that was defined in it /// </summary> /// <param name="sys">The actor system</param> public static void StartNameSpaceActorsFromConfiguration(this ActorSystem sys) { var config = sys.Settings.Config.GetConfig("akka.actor.deployment"); if (config == null) { return; } foreach (var pair in config.AsEnumerable()) { var key = pair.Key; var path = key.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (path.Length != 1) { continue; } var isNameSpace = config.GetConfig(key).GetBoolean("IsNameSpace"); if (isNameSpace) { sys.ActorOf(sys.DI().Props(typeof(NameSpaceActor)), path[0]); sys.Log.Info( "{Type}: starting namespace {NameSpaceName}", typeof(ActorSystemUtils).Name, path[0]); } } }
public static IActorRef SignalHub(this ActorSystem system) { if (Nobody.Instance.Equals(_hub)) _hub = system.ActorOf<HubManager>(HubManager.Name); return _hub; }
public static IActorRef SignalClient(this ActorSystem system) { if (Equals(_clientManager, Nobody.Instance)) _clientManager = system.ActorOf<ClientManager>(ClientManager.Name); return _clientManager; }
public static IActorRef CreateTestActor(this ActorSystem system, ActorProps actorToBeTested) { return system.ActorOf(ActorProps.Create<TestManagerActor>(actorToBeTested)); }