DefaultGuiController

class DefaultGuiController(workspaceConfiguration: WorkspaceConfiguration, baseProfiles: Iterable<SolverProfile>, parentScope: CoroutineScope, extensions: GuiExtensionRegistry = GuiExtensionRegistry(), metadata: ApplicationMetadata = ApplicationMetadata()) : GuiController

Default presentation-independent application controller.

All public state is immutable. Live solvers, cursors and jobs are held in PageRuntime and keyed by PageId. Every asynchronous update verifies its ResolutionSessionId, which prevents cancelled or stale computations from mutating a later resolution or another selected page.

Constructors

Link copied to clipboard
constructor(workspaceConfiguration: WorkspaceConfiguration, baseProfiles: Iterable<SolverProfile>, parentScope: CoroutineScope, extensions: GuiExtensionRegistry = GuiExtensionRegistry(), metadata: ApplicationMetadata = ApplicationMetadata())

Properties

Link copied to clipboard
open override val effects: Flow<GuiEffect>

Lossless, ordered, single-consumer requests to the hosting platform.

Link copied to clipboard
open override val events: SharedFlow<GuiEvent>

Discrete, possibly-missed-if-unsubscribed notifications about what just happened (e.g. for logging/tests) - unlike effects, losing one doesn't break correctness since state always reflects the latest truth.

Link copied to clipboard
open override val state: StateFlow<GuiState>

The full application state at any point in time; a frontend renders itself from this.

Functions

Link copied to clipboard
open suspend override fun dispatch(action: GuiAction)

Applies one action, updating GuiModel.state and/or emitting GuiModel.events/GuiModel.effects.

Link copied to clipboard
open suspend override fun shutdown()

Releases every resource this controller holds (solver sessions, coroutines); unusable afterwards.