public annotation DestroyMethod:
Marks a method that must be called when a managed component is destroyed.
The DI runtime can use this annotation to release resources owned by a component before the context is closed.
import klyn.di
public class CacheService:
@DestroyMethod
public stop() as Void:
print("Cache service stopped")