LifecycleNode

A node that owns resources across attachment, detachment, and disposal.

The runtime invokes lifecycle callbacks on the owning tree thread. Attachment is parent-first. Cleanup is reverse-sibling descendant-first and attempts each callback at most once. It calls detach after every attempted attach, including a failed attempt. It disposes bound nodes whose attach callback was never reached. Cleanup continues after callback failures and suppresses later distinct failures on the primary failure. A lifecycle callback failure during an active tree operation is propagated unchanged and poisons the tree. A cleanup callback failure during close leaves the tree closed after cleanup attempts.

Inheritors

Functions

Link copied to clipboard
abstract fun attach()

Acquires resources after the node is inserted into a tree.

Link copied to clipboard
abstract fun detach()

Releases attachment-scoped resources while retaining runtime identity and binding ownership through the subsequent dispose attempt.

Link copied to clipboard
abstract fun dispose()

Permanently releases resources owned by this node.