Files
Umbraco-CMS/src/Umbraco.Core/Composing/IComponent.cs
Ronald Barendse cf6137db18 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
2024-09-23 09:45:46 +02:00

33 lines
772 B
C#

namespace Umbraco.Cms.Core.Composing;
/// <inheritdoc />
[Obsolete("Use IAsyncComponent instead. This interface will be removed in a future version.")]
public interface IComponent : IAsyncComponent
{
/// <summary>
/// Initializes the component.
/// </summary>
void Initialize();
/// <summary>
/// Terminates the component.
/// </summary>
void Terminate();
/// <inheritdoc />
Task IAsyncComponent.InitializeAsync(bool isRestarting, CancellationToken cancellationToken)
{
Initialize();
return Task.CompletedTask;
}
/// <inheritdoc />
Task IAsyncComponent.TerminateAsync(bool isRestarting, CancellationToken cancellationToken)
{
Terminate();
return Task.CompletedTask;
}
}