aboutsummaryrefslogtreecommitdiff
path: root/lib/Plugins.Runtime/src/LivePlugin.cs
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-01-02 02:33:05 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2024-01-02 02:33:05 -0500
commit4ef0142747c4a0dd0c4cb71d8e7359c03b3a2942 (patch)
tree2991941aec6a0b981411a4f4bb83d8d2ad900aba /lib/Plugins.Runtime/src/LivePlugin.cs
parenta6b628c8653485a803bdbe322e2ecd2a69fc8e5a (diff)
breaking changes: plugin service pools & move plugin api away from web related
Diffstat (limited to 'lib/Plugins.Runtime/src/LivePlugin.cs')
-rw-r--r--lib/Plugins.Runtime/src/LivePlugin.cs19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/Plugins.Runtime/src/LivePlugin.cs b/lib/Plugins.Runtime/src/LivePlugin.cs
index 573b520..3ed2ad6 100644
--- a/lib/Plugins.Runtime/src/LivePlugin.cs
+++ b/lib/Plugins.Runtime/src/LivePlugin.cs
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2023 Vaughn Nugent
+* Copyright (c) 2024 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Plugins.Runtime
@@ -130,6 +130,23 @@ namespace VNLib.Plugins.Runtime
}
/// <summary>
+ /// Gets services from the plugin if it is loaded and
+ /// publishes them to the pool
+ /// </summary>
+ /// <param name="pool">The service pool to collect services into</param>
+ /// <exception cref="InvalidOperationException"></exception>
+ internal void GetServices(IPluginServicePool pool)
+ {
+ if (!_loaded)
+ {
+ throw new InvalidOperationException("Plugin is not loaded");
+ }
+
+ //Load services into pool
+ Plugin?.PublishServices(pool);
+ }
+
+ /// <summary>
/// Invokes the plugins console event handler if the type has one
/// and the plugin is loaded.
/// </summary>