diff options
Diffstat (limited to 'lib/VNLib.Plugins.Extensions.Loading/src')
3 files changed, 21 insertions, 24 deletions
diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/Events/ConfigurableAsyncIntervalAttribute.cs b/lib/VNLib.Plugins.Extensions.Loading/src/Events/ConfigurableAsyncIntervalAttribute.cs index 429cb18..171a9ae 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/Events/ConfigurableAsyncIntervalAttribute.cs +++ b/lib/VNLib.Plugins.Extensions.Loading/src/Events/ConfigurableAsyncIntervalAttribute.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2024 Vaughn Nugent * * Library: VNLib * Package: VNLib.Plugins.Extensions.Loading @@ -33,18 +33,25 @@ namespace VNLib.Plugins.Extensions.Loading.Events [AttributeUsage(AttributeTargets.Method)] public sealed class ConfigurableAsyncIntervalAttribute : Attribute { - internal readonly string IntervalPropertyName; - internal readonly IntervalResultionType Resolution; + /// <summary> + /// The configuration property name for the event interval + /// </summary> + public string IntervalPropertyName { get; } + + /// <summary> + /// The time resoltion for the event interval + /// </summary> + public IntervalResultionType Resolution { get; } /// <summary> /// Initializes a <see cref="ConfigurableAsyncIntervalAttribute"/> with the specified /// interval property name /// </summary> - /// <param name="configPropName">The configuration property name for the event interval</param> + /// <param name="intervalPropertyName">The configuration property name for the event interval</param> /// <param name="resolution">The time resoltion for the event interval</param> - public ConfigurableAsyncIntervalAttribute(string configPropName, IntervalResultionType resolution) + public ConfigurableAsyncIntervalAttribute(string intervalPropertyName, IntervalResultionType resolution) { - IntervalPropertyName = configPropName; + IntervalPropertyName = intervalPropertyName; Resolution = resolution; } } diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs b/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs index 235aaf6..979ade2 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs +++ b/lib/VNLib.Plugins.Extensions.Loading/src/LoadingExtensions.cs @@ -373,21 +373,6 @@ namespace VNLib.Plugins.Extensions.Loading } /// <summary> - /// Adds a service to the <see cref="IServiceContainer"/> using generics syntax - /// </summary> - /// <typeparam name="T"></typeparam> - /// <param name="container"></param> - /// <param name="service">The service instance to add to the container</param> - /// <exception cref="ArgumentNullException"></exception> - public static void AddService<T>(this IServiceContainer container, T service) - { - _ = container ?? throw new ArgumentNullException(nameof(container)); - _ = service ?? throw new ArgumentNullException(nameof(service)); - - container.AddService(typeof(T), service); - } - - /// <summary> /// Creates a new instance of the desired service type from an external assembly and /// caches the loaded assembly so it's never loaded more than once. Managed assembly /// life cycles are managed by the plugin. Instances are treated as services and @@ -433,7 +418,12 @@ namespace VNLib.Plugins.Extensions.Loading } /// <summary> - /// + /// Exports a service of the desired type to the host application. Once the plugin + /// is done loading, the host will be able to access the service instance. + /// <para> + /// You should avoid mutating the service instance after the plugin has been + /// loaded, especially if you are using factory methods to create the service. + /// </para> /// </summary> /// <typeparam name="T"></typeparam> /// <param name="plugin"></param> diff --git a/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj b/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj index 1d2f57f..63bce5a 100644 --- a/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj +++ b/lib/VNLib.Plugins.Extensions.Loading/src/VNLib.Plugins.Extensions.Loading.csproj @@ -1,7 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> - <TargetFramework>net6.0</TargetFramework> + <TargetFramework>net8.0</TargetFramework> <RootNamespace>VNLib.Plugins.Extensions.Loading</RootNamespace> <AssemblyName>VNLib.Plugins.Extensions.Loading</AssemblyName> <GenerateDocumentationFile>True</GenerateDocumentationFile> @@ -16,7 +16,7 @@ <Product>VNLib.Plugins.Extensions.Loading</Product> <PackageId>VNLib.Plugins.Extensions.Loading</PackageId> <Description>An Essentials framework extension library for common loading/configuration/service operations. Enables rapid plugin and service development.</Description> - <Copyright>Copyright © 2023 Vaughn Nugent</Copyright> + <Copyright>Copyright © 2024 Vaughn Nugent</Copyright> <PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Plugins.Extensions</PackageProjectUrl> <RepositoryUrl>https://github.com/VnUgE/VNLib.Plugins.Extensions/tree/master/lib/VNLib.Plugins.Extensions.Loading</RepositoryUrl> </PropertyGroup> |