public ActorReceives <T> ItShouldCreateChildActor(Type childActorType, ActorSetUpOptions options = null) { return(ItShouldDo((actorAccess) => { HandleChildActorType(childActorType, actorAccess.ActorChildren, (actor) => { actor.ActorRef = CreateChildActor(actorAccess.Context, actor.ActorType, options ?? new ActorSetUpOptions()); }); })); }
private static IActorRef CreateChildActor(IActorContext context, Type actorType, ActorSetUpOptions options) { var props = context.DI().Props(actorType); props = SelectableActor.PrepareProps(options, props); var actorRef = context.ActorOf(props, SelectableActor.GetActorNameByType(null, actorType)); return(actorRef); }
public IActorRef CreateActor <T>(ActorSetUpOptions option = null, ActorMetaData parentActorMetaData = null) where T : ActorBase { return(ActorSystem.CreateActor <T>(option, parentActorMetaData)); }