aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2023-09-22 21:10:49 -0400
committerPatrick Barron <barronpm@gmail.com>2023-09-23 11:57:38 -0400
commit493de3297a415061f8d6a69ff9f62261c3159a2a (patch)
tree00f1d83732b79bee796440723d5e1f1c9b355ad1 /MediaBrowser.Common
parent1d8c3e088be75ce02b811afaeea20307df0487be (diff)
Use IHostLifetime to handle restarting and shutting down
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/IApplicationHost.cs21
-rw-r--r--MediaBrowser.Common/Plugins/IPluginManager.cs5
2 files changed, 7 insertions, 19 deletions
diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs
index 96ee701b3..c1ea6e87c 100644
--- a/MediaBrowser.Common/IApplicationHost.cs
+++ b/MediaBrowser.Common/IApplicationHost.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Reflection;
-using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
namespace MediaBrowser.Common
@@ -42,10 +41,15 @@ namespace MediaBrowser.Common
bool HasPendingRestart { get; }
/// <summary>
- /// Gets a value indicating whether this instance is currently shutting down.
+ /// Gets or sets a value indicating whether this instance is currently shutting down.
/// </summary>
/// <value><c>true</c> if this instance is shutting down; otherwise, <c>false</c>.</value>
- bool IsShuttingDown { get; }
+ bool IsShuttingDown { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether the application should restart.
+ /// </summary>
+ bool ShouldRestart { get; set; }
/// <summary>
/// Gets the application version.
@@ -88,11 +92,6 @@ namespace MediaBrowser.Common
void NotifyPendingRestart();
/// <summary>
- /// Restarts this instance.
- /// </summary>
- void Restart();
-
- /// <summary>
/// Gets the exports.
/// </summary>
/// <typeparam name="T">The type.</typeparam>
@@ -124,12 +123,6 @@ namespace MediaBrowser.Common
T Resolve<T>();
/// <summary>
- /// Shuts down.
- /// </summary>
- /// <returns>A task.</returns>
- Task Shutdown();
-
- /// <summary>
/// Initializes this instance.
/// </summary>
/// <param name="serviceCollection">Instance of the <see cref="IServiceCollection"/> interface.</param>
diff --git a/MediaBrowser.Common/Plugins/IPluginManager.cs b/MediaBrowser.Common/Plugins/IPluginManager.cs
index 1d73de3c9..0ff9719e9 100644
--- a/MediaBrowser.Common/Plugins/IPluginManager.cs
+++ b/MediaBrowser.Common/Plugins/IPluginManager.cs
@@ -30,11 +30,6 @@ namespace MediaBrowser.Common.Plugins
IEnumerable<Assembly> LoadAssemblies();
/// <summary>
- /// Unloads all of the assemblies.
- /// </summary>
- void UnloadAssemblies();
-
- /// <summary>
/// Registers the plugin's services with the DI.
/// Note: DI is not yet instantiated yet.
/// </summary>