/// <summary> /// Validates the specified <see cref="RedisOrchestrationServiceSettings"/> object. /// </summary> /// <param name="settings">The <see cref="RedisOrchestrationServiceSettings"/> object to validate.</param> /// <returns>Returns <paramref name="settings"/> if successfully validated.</returns> public static RedisOrchestrationServiceSettings Validate(RedisOrchestrationServiceSettings settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } if (string.IsNullOrEmpty(settings.RedisConnectionString)) { throw new ArgumentNullException(nameof(settings.RedisConnectionString)); } if (settings.MaxConcurrentTaskOrchestrationWorkItems <= 0) { throw new ArgumentOutOfRangeException(nameof(settings.MaxConcurrentTaskOrchestrationWorkItems)); } if (settings.MaxConcurrentTaskActivityWorkItems <= 0) { throw new ArgumentOutOfRangeException(nameof(settings.MaxConcurrentTaskActivityWorkItems)); } return(settings); }
/// <summary> /// Initializes a new instance of the <see cref="RedisOrchestrationService"/> class. /// </summary> /// <param name="settings">The settings used to configure the orchestration service.</param> public RedisOrchestrationService(RedisOrchestrationServiceSettings settings) { this.settings = RedisOrchestrationServiceSettings.Validate(settings); }