You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Orleans uses Options and I Configuration but doesn't link the two. Out of the box a silo cannot be directly configured a IConfigurable source (say json) without developers writing custom conversion code (read from IConfig, then set options) to do so, which should not be necessary as options can be initialized from IConfig. The reason for this is that the various configuration hooks and extension functions do not take configuration sources as the underlying options calls do.
For instance, instead of just having:
public static ISiloBuilder Configure<TOptions>(this ISiloBuilder builder, Action<TOptions> configureOptions) where TOptions : class
{
return builder.ConfigureServices(services => services.Configure(configureOptions));
}
Which requires and action be written by the developer, wherein they must set the option values, if there were also overrides for reading from I config.. something like:
public static ISiloBuilder Configure<TOptions>(this ISiloBuilder builder, IConfigurationSection section) where TOptions : class
{
return builder.ConfigureServices(services => services.Configure<TOptions>(section));
}
and/or
public static ISiloBuilder Configure<TOptions>(this ISiloBuilder builder, IConfigurationRoot configurationRoot) where TOptions : class
{
return builder.ConfigureServices(services => services.Configure<TOptions>(configurationRoot.GetSection(typeof(TOptions).Name)));
}
Then using Orleans with IConfiguration (the expected pattern) would be much simpler and cleaner.
Note: The above examples are half baked at best. Please consider before settling on a general pattern.
The text was updated successfully, but these errors were encountered:
We are marking this issue as stale due to the lack of activity in the past six months. If there is no further activity within two weeks, this issue will be closed. You can always create a new issue based on the guidelines provided in our pinned announcement.
Orleans uses Options and I Configuration but doesn't link the two. Out of the box a silo cannot be directly configured a IConfigurable source (say json) without developers writing custom conversion code (read from IConfig, then set options) to do so, which should not be necessary as options can be initialized from IConfig. The reason for this is that the various configuration hooks and extension functions do not take configuration sources as the underlying options calls do.
For instance, instead of just having:
Which requires and action be written by the developer, wherein they must set the option values, if there were also overrides for reading from I config.. something like:
and/or
Then using Orleans with IConfiguration (the expected pattern) would be much simpler and cleaner.
Note: The above examples are half baked at best. Please consider before settling on a general pattern.
The text was updated successfully, but these errors were encountered: