diff options
author | vnugent <public@vaughnnugent.com> | 2023-04-15 01:58:55 -0400 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-04-15 01:58:55 -0400 |
commit | 3ce61cf38727db2f37a0e478182d2a73222c8a7c (patch) | |
tree | a03bf1bdde44961183b7bb34dea9c3381050dc27 /lib/Plugins.Runtime/src/LoaderExtensions.cs | |
parent | baf859f45cf1f00e79508954517ed4b6fb446103 (diff) |
Managed assembly loading overhaul
Diffstat (limited to 'lib/Plugins.Runtime/src/LoaderExtensions.cs')
-rw-r--r-- | lib/Plugins.Runtime/src/LoaderExtensions.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Plugins.Runtime/src/LoaderExtensions.cs b/lib/Plugins.Runtime/src/LoaderExtensions.cs index 13fbb11..d4c100b 100644 --- a/lib/Plugins.Runtime/src/LoaderExtensions.cs +++ b/lib/Plugins.Runtime/src/LoaderExtensions.cs @@ -26,7 +26,6 @@ using System; using System.IO; using System.Linq; using System.Text.Json; -using System.Threading.Tasks; namespace VNLib.Plugins.Runtime @@ -121,10 +120,10 @@ namespace VNLib.Plugins.Runtime /// </summary> /// <param name="loader"></param> /// <returns>A new <see cref="JsonDocument"/> of the loaded configuration file</returns> - public static async Task<JsonDocument> GetPluginConfigAsync(this RuntimePluginLoader loader) + public static JsonDocument GetPluginConfigAsync(this RuntimePluginLoader loader) { //Open and read the config file - await using FileStream confStream = File.OpenRead(loader.PluginConfigPath); + using FileStream confStream = File.OpenRead(loader.PluginConfigPath); JsonDocumentOptions jdo = new() { @@ -133,7 +132,7 @@ namespace VNLib.Plugins.Runtime }; //parse the plugin config file - return await JsonDocument.ParseAsync(confStream, jdo); + return JsonDocument.Parse(confStream, jdo); } /// <summary> @@ -156,7 +155,7 @@ namespace VNLib.Plugins.Runtime /// single plugin that derrives the specified type /// </summary> /// <typeparam name="T">The type the plugin must derrive from</typeparam> - /// <param name="loader"></param> + /// <param name="collection"></param> /// <returns>The instance of your custom type casted, or null if not found or could not be casted</returns> public static T? GetExposedTypes<T>(this PluginController collection) where T: class { |