public IActorRef Create(IActorContext actorContext, ActorSetUpOptions options = null) { var props = actorContext.DI().Props(Actortype); props = PrepareProps(options, props); return(actorContext.ActorOf(props, name: ActorName)); }
public IActorRef Create(ActorSystem system, ActorSetUpOptions options = null) { var props = system.DI().Props(Actortype); props = PrepareProps(options, props); return(system.ActorOf(props, ActorName)); }
public static Props PrepareProps(ActorSetUpOptions options, Props props) { if (options != null) { if (options.RouterConfig != null) { props = props.WithRouter(options.RouterConfig); } if (options.SupervisoryStrategy != null) { props = props.WithSupervisorStrategy(options.SupervisoryStrategy); } if (options.Dispatcher != null) { props = props.WithDispatcher(options.Dispatcher); } if (options.MailBox != null) { props = props.WithMailbox(options.MailBox); } } return(props); }
public static IActorRef CreateActor <T>(this IActorContext actorContext, ActorSetUpOptions option = null, ActorMetaData parentActorMetaData = null) where T : ActorBase { return(actorContext.System.CreateActorSelector <T>(parentActorMetaData).Create(actorContext, option)); }