private static RegionEndpoint GetAwsRegionEndpoint(StepFunctionsConfig config) { var regionEndpoint = string.IsNullOrEmpty(config.AwsRegion) ? RegionEndpoint.EUWest1 : RegionEndpoint.GetBySystemName(config.AwsRegion); return(regionEndpoint); }
internal StepFunctionsBuilder(IServiceCollection serviceCollectionCollection, StepFunctionsConfig stepFunctionsConfig, FileStoreFactoryConfig fileStoreFactoryConfig) { _fileStoreFactoryConfig = fileStoreFactoryConfig; Config = stepFunctionsConfig; ServiceCollection = serviceCollectionCollection; ServiceCollection.AddSingleton(fileStoreFactoryConfig); ServiceCollection.AddSingleton(x => new FileStoreFactory(x)); }
internal WorkerHostedService(IWorker worker, IHeartbeatManager heartbeatManager, StepFunctionsConfig config, AmazonStepFunctionsClient client, ILoggerFactory loggerFactory) { _heartbeatManager = heartbeatManager; _logger = loggerFactory.CreateLogger <WorkerHostedService>(); LoggerFactory = loggerFactory; Client = client; Worker = worker; Config = config; _logger.LogDebug($"Creating TaskWorkerHostedService: '{worker.ActivityName}'"); }
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); }