コード例 #1
0
        internal Actor Activate(IActorHost host, ActorPath path, IActorRuntime runtime)
        {
            var instance = Activator.Activate(actor, path.Id, runtime, dispatcher);

            instance.Initialize(host, path, runtime, dispatcher);
            return(instance);
        }
コード例 #2
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();
        }
コード例 #3
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();
        }
コード例 #4
0
ファイル: ActorBinding.cs プロジェクト: pkese/Orleankka
        static void SetReceiver(Type actor, EndpointConfiguration config)
        {
            dispatchers.Add(actor, new Dispatcher(actor));

            config.Activator = (path, runtime) =>
            {
                var dispatcher = dispatchers[actor];

                var instance = Activator.Activate(actor, path.Id, runtime, dispatcher);
                instance.Initialize(path, runtime, dispatcher);

                return(instance);
            };
        }
コード例 #5
0
        public static Actor Activate(this IActorActivator activator, ActorPath path, IActorRuntime runtime)
        {
            var type = ActorType.Registered(path.Code);

            return(activator.Activate(type.Implementation, path.Id, runtime));
        }