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); }
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(); }
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(); }
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); }; }
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)); }