public close() as Void throws Exception:
Closes this context and destroys managed components in reverse creation order.
Methods annotated with @DestroyMethod are invoked once before their component registration is removed. Components registered directly with registerComponent(...) remain caller-owned and are not destroyed.
import klyn.di context = DIContext() context.createComponent(CacheService.type) context.close()