Add IAsyncComponent to allow async initialize/terminate (#16536)

* Add IAsyncComponent

* Rewrite to use IAsyncComposer

* Add AsyncComponentBase and RuntimeAsyncComponentBase

* Remove manual disposing of components on restart
This commit is contained in:
Ronald Barendse
2024-09-23 09:45:46 +02:00
committed by GitHub
parent 2270db6efc
commit cf6137db18
13 changed files with 221 additions and 100 deletions

View File

@@ -41,8 +41,9 @@ public static class ObjectExtensions
public static IEnumerable<T> AsEnumerableOfOne<T>(this T input) => Enumerable.Repeat(input, 1);
/// <summary>
/// Disposes the object if it implements <see cref="IDisposable" />.
/// </summary>
/// <param name="input"></param>
/// <param name="input">The object.</param>
public static void DisposeIfDisposable(this object input)
{
if (input is IDisposable disposable)