Skip to content
简体中文

Lifecycle components ​

Register lifecycle components with AddComponent and implement the interfaces each service needs.

CapabilityInterface
Synchronous initializationIInitializable
Asynchronous initializationIAsyncInitializable
Synchronous shutdownIDestroyable
Asynchronous shutdownIAsyncDestroyable

Implement IDisposable or IAsyncDisposable for resource cleanup and let the instance owner call it. Wait for components at startup and finish application work before disposal. See application composition for ordering and ownership.

Apache License 2.0