Beispiel #1
0
        async Task Activate(ActorPath path)
        {
            var system = ClusterActorSystem.Current;

            actor = Activator.Activate(path.Type);
            actor.Initialize(path.Id, system, this, ActorPrototype.Of(path.Type));

            await actor.OnActivate();
        }
Beispiel #2
0
        public static void Reset()
        {
            ResetThis();

            ActorInterface.Reset();
            ActorPrototype.Reset();
            ActorEndpointFactory.Reset();
            StreamProvider.Reset();
            Ref.Reset();
        }
Beispiel #3
0
        static void Register(Type actor)
        {
            var type = RegisterThis(actor);

            ActorInterface.Register(type);
            ActorPrototype.Register(type);
            ActorEndpointFactory.Register(type);
            StreamProvider.Register(type);
            Ref.Register(type);
        }
Beispiel #4
0
        public static void Reset()
        {
            ResetThis();

            ActorInterface.Reset();
            ActorPrototype.Reset();
            ActorEndpointFactory.Reset();

            Ref.Reset();
            StreamSubscriptionMatcher.Reset();
        }
Beispiel #5
0
        static void Register(Type actor)
        {
            var type = RegisterThis(actor);

            ActorInterface.Register(type);
            ActorPrototype.Register(type);
            ActorEndpointFactory.Register(type);

            Ref.Register(type);
            StreamSubscriptionMatcher.Register(type);
        }
Beispiel #6
0
        async Task Activate(ActorPath path)
        {
            var system = ClusterActorSystem.Current;

            var runtime   = new ActorRuntime(system, this);
            var prototype = ActorPrototype.Of(path.Type);

            actor = Activator.Activate(path.Type, path.Id, runtime);
            actor.Initialize(path.Id, runtime, prototype);

            await actor.OnActivate();
        }
Beispiel #7
0
        static void Register(Assembly assembly)
        {
            var actors = assembly
                         .GetTypes()
                         .Where(x =>
                                !x.IsAbstract &&
                                typeof(Actor).IsAssignableFrom(x));

            foreach (var type in actors)
            {
                ActorTypeCode.Register(type);
                ActorPrototype.Register(type);
                ActorEndpointDynamicFactory.Register(type);
            }
        }
Beispiel #8
0
 public static void Reset()
 {
     ActorTypeCode.Reset();
     ActorPrototype.Reset();
     ActorEndpointDynamicFactory.Reset();
 }