示例#1
0
        public static void AddProtoActor(this IServiceCollection services, Action <ActorPropsRegistry> registerAction = null)
        {
            services.AddSingleton <IActorFactory, ActorFactory>();

            var registry = new ActorPropsRegistry();

            registerAction?.Invoke(registry);
            services.AddSingleton(registry);
        }
        public static void AddProtoActor(this IServiceCollection services, Action <ActorPropsRegistry> registerAction = null)
        {
            services.AddSingleton <IActorFactory, ActorFactory>();
            services.TryAdd(ServiceDescriptor.Singleton(typeof(EventStream <>), typeof(EventStream <>)));

            var registry = new ActorPropsRegistry();

            registerAction?.Invoke(registry);
            services.AddSingleton(registry);
        }
示例#3
0
 public ActorFactory(IServiceProvider serviceProvider, ActorPropsRegistry actorPropsRegistry)
 {
     this.serviceProvider    = serviceProvider;
     this.actorPropsRegistry = actorPropsRegistry;
 }
 public ActorFactory(IServiceProvider serviceProvider, ActorPropsRegistry actorPropsRegistry)
 {
     _serviceProvider    = serviceProvider;
     _actorPropsRegistry = actorPropsRegistry;
 }
 public ActorFactory(ActorSystem actorSystem, IServiceProvider serviceProvider, ActorPropsRegistry actorPropsRegistry)
 {
     _actorSystem        = actorSystem;
     _serviceProvider    = serviceProvider;
     _actorPropsRegistry = actorPropsRegistry;
 }