Exemple #1
0
        public ActorMetadata(string name, ActorMetadata parent = null)
        {
            Name = name;

            var parentPath = parent != null ? parent.Path : "/user";
            Path = $"{parentPath}/{Name}";

            Parent = parent;
        }
Exemple #2
0
        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);
     //}
 }
Exemple #4
0
 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);
     }));
 }
Exemple #5
0
 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)));
 }
Exemple #6
0
 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);
 }
Exemple #7
0
 public ActorMetadata(string name, Type actorType, ActorMetadata parent = null) : this(name, parent)
 {
     ActorType = actorType;
 }
Exemple #8
0
 public ActorMetadata(Type actorType, ActorMetadata parent = null) : this(null, actorType, parent)
 {
 }
Exemple #9
0
 public IActorRef ActorOf <TProps>(ActorMetadata actor) where TProps : ActorBase
 {
     return(_actorSystem.ActorOf(_actorSystem.DI().Props <TProps>(), actor.Name));
 }
Exemple #10
0
 public IActorRef ActorOf(ActorMetadata actor)
 {
     return(_actorSystem.ActorOf(_actorSystem.DI().Props(actor.ActorType), actor.Name));
 }
Exemple #11
0
 public ActorMetadata(string name, Type actorType, ActorMetadata parent = null)
     : this(name, parent)
 {
     ActorType = actorType;
 }
Exemple #12
0
 public ActorMetadata(Type actorType, ActorMetadata parent = null)
     : this(null, actorType, parent)
 {
 }
 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);
     //}
 }