Ejemplo n.º 1
0
        internal StepFunctionsBuilder(IServiceCollection serviceCollectionCollection,
                                      StepFunctionsConfig stepFunctionsConfig,
                                      FileStoreFactoryConfig fileStoreFactoryConfig)
        {
            _fileStoreFactoryConfig = fileStoreFactoryConfig;
            Config            = stepFunctionsConfig;
            ServiceCollection = serviceCollectionCollection;

            ServiceCollection.AddSingleton(fileStoreFactoryConfig);
            ServiceCollection.AddSingleton(x => new FileStoreFactory(x));
        }
Ejemplo n.º 2
0
        public static IServiceCollection AddStepFunctions(this IServiceCollection services,
                                                          StepFunctionsConfig stepFunctionsConfig,
                                                          FileStoreFactoryConfig fileStoreFactoryConfig,
                                                          Action <StepFunctionsBuilder> builder)
        {
            ;
            var sfb = new StepFunctionsBuilder(services, stepFunctionsConfig, fileStoreFactoryConfig);

            builder(sfb);
            services.AddSingleton <HeartbeatHostedService>();
            services.AddTransient <IHeartbeatManager>(x => x.GetService <HeartbeatHostedService>());
            services.AddTransient <IHostedService>(x => x.GetService <HeartbeatHostedService>());
            services.AddSingleton(sfb.Config);
            services.AddTransient(GetAmazonStepFunctionsClient);

            return(services);
        }