public ActorMetadata(string name, ActorMetadata parent = null) { Name = name; var parentPath = parent != null ? parent.Path : "/user"; Path = $"{parentPath}/{Name}"; Parent = parent; }
public static ActorSelection ActorSelection(this ActorSystem actorSystem, ActorMetadata actor, ActorPathType path = ActorPathType.Absolute) { return(actorSystem.ActorSelection(actor.Path)); //switch (path) //{ // case ActorPathType.Absolute: // return actorSystem.ActorSelection(actor.AbsoluteUri); // case ActorPathType.Relative: // return actorSystem.ActorSelection(actor.RelativeUri); // default: // return actorSystem.ActorSelection(actor.AbsoluteUri); //} }
WithInjectedActorSelection <TLimit, TActivatorData, TRegistrationStyle>(this IRegistrationBuilder <TLimit, TActivatorData, TRegistrationStyle> builder, ActorMetadata actorEntry, ActorPathType pathType) where TActivatorData : ReflectionActivatorData { return(builder.WithParameter((param, ctx) => param.Name == actorEntry.Name, (param, ctx) => { var actorSystem = ctx.Resolve <IActorSystemAdapter>(); return actorSystem.ActorSelection(actorEntry.Path); })); }
WithInjectedActor <TLimit, TActivatorData, TRegistrationStyle>(this IRegistrationBuilder <TLimit, TActivatorData, TRegistrationStyle> builder, ActorMetadata actorEntry) where TActivatorData : ReflectionActivatorData { return(builder.WithParameter((param, ctx) => param.Name == actorEntry.Name, (param, ctx) => ctx.ResolveNamed <IActorRef>(actorEntry.Name))); }
RegisterActor <TActor>(this ContainerBuilder builder, ActorSystem system, AutoFacDependencyResolver props, ActorMetadata actorEntry) where TActor : ActorBase { return(builder.Register(ctx => system.ActorOf(props.Create <TActor>(), actorEntry.Name)).Named <IActorRef>(actorEntry.Name)); //var actorInstance = system.ActorOf(props.Create<TActor>(), actorEntry.Name); //return builder.RegisterInstance(actorInstance).Named<IActorRef>(actorEntry.Name); }
public ActorMetadata(string name, Type actorType, ActorMetadata parent = null) : this(name, parent) { ActorType = actorType; }
public ActorMetadata(Type actorType, ActorMetadata parent = null) : this(null, actorType, parent) { }
public IActorRef ActorOf <TProps>(ActorMetadata actor) where TProps : ActorBase { return(_actorSystem.ActorOf(_actorSystem.DI().Props <TProps>(), actor.Name)); }
public IActorRef ActorOf(ActorMetadata actor) { return(_actorSystem.ActorOf(_actorSystem.DI().Props(actor.ActorType), actor.Name)); }
public static IActorRef ActorOf(this IUntypedActorContext context, ActorMetadata actor) { return(context.ActorOf(context.DI().Props(actor.ActorType), actor.Name)); }
public static ActorSelection ActorSelection(this IUntypedActorContext context, ActorMetadata actor, ActorPathType path = ActorPathType.Absolute) { return(context.ActorSelection(actor.Path)); //switch (path) //{ // case ActorPathType.Absolute: // return context.ActorSelection(actor.Path); // case ActorPathType.Relative: // return context.ActorSelection(actor.RelativeUri); // default: // return context.ActorSelection(actor.AbsoluteUri); //} }