SplitScript reference / Language / onAttach

onAttach

lifecycle block

onAttach { ... }

Initializes one attached process.

This action is implicitly suspending and owns process-lifetime cancellation for await and retry continuations. When the state declaration contains named layout declarations, it returns the generated layout variant that should be polled.

Examples

Use onAttach

onAttach {
    let module = await process.module("GameAssembly.dll")
}
SymbolDescription
stateDeclares process attachment and persistent watched state.
layoutDeclares attachment-wide build dimensions or a named state memory shape.
awaitWaits for an asynchronous value and yields its result.
retryRetries synchronous fallible work until it succeeds.
onStateReadyInitializes one committed state snapshot.