public static IEventActor GetOrCreateEventActor(this IUntypedActorContext system, string name, bool killOnFirstResponse = false) { var child = system.Child(name); return(child.Equals(ActorRefs.Nobody) ? EventActor.Create(system, name, killOnFirstResponse) : EventActor.From(child)); }
public static Maybe <IEventActor> GetOrCreateEventActor(this IUntypedActorContext system, Maybe <string> name, bool killOnFirstResponse = false) => from realName in name from child in system.TryGetChild(name) select child.IsNobody() ? EventActor.Create(system, name, killOnFirstResponse) : EventActor.From(child);