Пример #1
0
        internal static ActorInterface Of(ActorPath path)
        {
            var type = ActorType.Registered(path.Code);

            var @interface = cache.Find(type);

            if (@interface == null)
            {
                throw new InvalidOperationException(
                          $"Can't find interface for path '{path}'." +
                          "Make sure you've registered assembly containing this type");
            }

            return(@interface);
        }
Пример #2
0
        public static IActorEndpoint Proxy(ActorPath path)
        {
            var type = ActorType.Registered(path.Code);

            var factory = factories.Find(type);

            if (factory == null)
            {
                throw new InvalidOperationException(
                          $"Path '{path}' is not registered as an Actor or Worker." +
                          "Make sure you've registered assembly containing this type");
            }

            return((IActorEndpoint)factory(path.Serialize()));
        }
Пример #3
0
 internal static ActorPrototype Of(string code) => Of(ActorType.Registered(code));
Пример #4
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));
        }