コード例 #1
0
        protected virtual void RegisterBaseDependencies()
        {
            var actorRegistry = new ActorPropsRegistry();

            _container.RegisterInstance(actorRegistry);
            _container.RegisterSingleton <IServiceProvider, SimpleInjectorServiceProvider>();
            _container.RegisterSingleton <IActorFactory, ActorFactory>();
            _container.RegisterSingleton <IEventAggregator, EventAggregator>();
            _container.RegisterSingleton <IMessageBroker, MessageBroker>();
            _container.RegisterSingleton <IConcurrencyProvider, ConcurrencyProvider>();
            _container.RegisterSingleton <IObservableTimer, ObservableTimer>();

            _container.RegisterSingleton <IRoslynCompilerService, RoslynCompilerService>();
        }
コード例 #2
0
        public static IServiceCollection UseTinyService(this IServiceCollection container, Action <ActorPropsRegistry> registerAction = null)
        {
            container.AddSingleton <ISerializationService, DefaultSerializationService>();

            container.AddSingleton <IScheduleService, TimerScheduleService>();

            container.AddSingleton <IActorFactory, ActorFactory>();

            var registry = new ActorPropsRegistry();

            registerAction?.Invoke(registry);

            container.AddSingleton(registry);

            return(container);
        }
コード例 #3
0
 public ActorFactory(IContainer container, ActorPropsRegistry registry)
 {
     _container = container ?? throw new ArgumentNullException(nameof(container));
     _registry  = registry ?? throw new ArgumentNullException(nameof(registry));
 }