示例#1
0
        private PID CreateActor <T>(string id, Proto.IContext parent, Func <Props> producer)
            where T : IActor
        {
            if (!_registry.RegisteredProps.TryGetValue(typeof(T), out var props))
            {
                props = x => x;
            }

            var props2 = props(producer());

            if (parent == null)
            {
                return(Actor.SpawnNamed(props2, id));
            }

            return(parent.SpawnNamed(props2, id));
        }
示例#2
0
 static PID CreateActor(string id, IContext parent, Func <Props> producer) => parent == null?Actor.SpawnNamed(producer(), id) : parent.SpawnNamed(producer(), id);