public void AssignActor(IActor actor, ActorHostInstancePolicy actorHostInstancePolicy = ActorHostInstancePolicy.TryReuseExisting) { AssertNotDisposed(); lock (@lock) { GetOrCreateActorHost(actor, actorHostInstancePolicy).AssignActor(actor); } }
private IActorHost GetOrCreateActorHost(IActor actor, ActorHostInstancePolicy actorHostInstancePolicy) { var actorHost = actorHosts.FirstOrDefault(ah => ah.CanAssignActor(actor)); if (actorHostInstancePolicy == ActorHostInstancePolicy.AlwaysCreateNew || !actorHosts.Any() || actorHost == null) { actorHost = actorHostFactory.Create(); actorHost.Start(); actorHosts.Add(actorHost); } return(actorHost); }
public void AssignActor(IActor actor, ActorHostInstancePolicy actorHostInstancePolicy = ActorHostInstancePolicy.TryReuseExisting) { AssertKinoBuilt(); actorHostManager.AssignActor(actor, actorHostInstancePolicy); }