SessionAttachmentNode

Optional session-attachment lifetime for resources that cannot remain active while their retained tree is detached.

Ordinary LifecycleNode ownership is unchanged: a session keeps its nodes across detachment and only performs ordinary lifecycle cleanup when a node leaves the tree. These additional callbacks run on the tree owner thread, never dispose a node, and must not mutate session state. Implementations must tolerate an already active initial attachment and an already suspended terminal cleanup. Callback failures trigger best-effort cleanup of the remaining nodes and preserve the original failure.

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.

Link copied to clipboard
abstract fun sessionAttached()

Ensures attachment-scoped observation is active when the owning session initially attaches or reattaches its retained tree.

Link copied to clipboard
abstract fun sessionDetached()

Immediately disables attachment-scoped observation while retaining node identity and authoritative external sources.