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

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

            Parent = parent;
        }
예제 #2
0
        public ActorMetadata(string name, ActorMetadata parent = null)
        {
            Name = name;

            var parentPath = parent != null ? parent.Path : "/user";

            Path = $"{parentPath}/{Name}";

            Parent = parent;
        }
예제 #3
0
 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);
     //}
 }
예제 #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);
     }));
 }
예제 #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)));
 }
예제 #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);
 }
예제 #7
0
 public ActorMetadata(string name, Type actorType, ActorMetadata parent = null) : this(name, parent)
 {
     ActorType = actorType;
 }
예제 #8
0
 public ActorMetadata(Type actorType, ActorMetadata parent = null) : this(null, actorType, parent)
 {
 }
예제 #9
0
 public IActorRef ActorOf <TProps>(ActorMetadata actor) where TProps : ActorBase
 {
     return(_actorSystem.ActorOf(_actorSystem.DI().Props <TProps>(), actor.Name));
 }
예제 #10
0
 public IActorRef ActorOf(ActorMetadata actor)
 {
     return(_actorSystem.ActorOf(_actorSystem.DI().Props(actor.ActorType), actor.Name));
 }
예제 #11
0
 public ActorMetadata(string name, Type actorType, ActorMetadata parent = null)
     : this(name, parent)
 {
     ActorType = actorType;
 }
예제 #12
0
 public ActorMetadata(Type actorType, ActorMetadata parent = null)
     : this(null, actorType, parent)
 {
 }
예제 #13
0
 public static IActorRef ActorOf(this IUntypedActorContext context, ActorMetadata actor)
 {
     return(context.ActorOf(context.DI().Props(actor.ActorType), actor.Name));
 }
예제 #14
0
 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);
     //}
 }