Enum ScyllaModuleState
Enumerates every state a IScyllaModule can occupy in the SMUT (Scylla ModUlar Topology) lifecycle state machine.
Namespace: Scylla.Core.Modules
Assembly: ScyllaCore.dll
Syntax
public enum ScyllaModuleState
Remarks
States progress in a deterministic, forward-only sequence during normal operation. The only bidirectional transition is between Enabled and Disabled, which supports toggling a module on and off at runtime without destroying its resources.
The normal lifecycle flow is:
- Discovered - registered with IScyllaModuleManager.
- Validated - dependency graph verified.
- Initialized - Initialize() completed.
- Started - StartModule() completed.
- Enabled / Disabled - runtime toggle.
- Shutdown - resources released; terminal state.
Error is an exceptional terminal state that can be entered from any non-terminal state when an unrecoverable failure occurs. Modules in this state trigger a fail-fast rollback of all previously initialized modules.
Fields
| Name | Description |
|---|---|
| Disabled | The module has been suspended via DisableModule(). Its allocated resources are intact but it is not processing runtime logic, fulfilling the framework's zero-cost disabled module guarantee. The module can be returned to Enabled at any time by calling EnableModule(). |
| Discovered | The module has been registered with IScyllaModuleManager via
RegisterModule(IScyllaModule) but has not yet undergone
dependency validation. This is the initial state of every module after its
|
| Enabled | The module is fully operational. EnableModule() has been called and the module is actively processing runtime logic. This is the normal steady-state for a running module. Calling DisableModule() transitions the module to Disabled. |
| Error | The module has encountered an unrecoverable error during validation, initialization, or runtime operation. When any module enters this state the framework halts the startup sequence (or triggers a runtime error report) and rolls back all previously initialized modules by calling their Shutdown() methods in reverse order. Modules in this state are skipped during StartAllModules() and will never reach Enabled. |
| Initialized | Initialize() has been called successfully. All module resources (data structures, subsystem registrations, native allocations) have been created and are ready for use. The module is awaiting the global StartAllModules() call before going live. |
| Shutdown | The module has completed Shutdown() and released all of its resources. This is a terminal state - a shut-down module cannot be re-initialized or re-enabled. Modules lingering in this state after the framework has finished teardown are called "zombie modules" and should be removed from the registry via CleanupZombieModules(bool). |
| Started | StartModule() has been called successfully. The module
has completed its inter-module wiring (event subscriptions, peer references)
and is transitioning to Enabled. This transient state is passed
through immediately during normal startup; it is exposed here so that diagnostic
tooling can detect a module stuck between |
| Validated | All hard dependencies declared in Dependencies have been confirmed to exist in the registry and satisfy any version constraints specified via MinVersion. The module is ready to receive dependency injection and begin initialization. |