![]() |
Bearsampp 2026.7.11
|
Static Public Member Functions | |
| static | getFiber (string $module) |
| static | getLoadedModules () |
| static | init () |
| static | isAvailable () |
| static | isLoaded (string $module) |
| static | isLoading (string $module) |
| static | loadInFiber (string $module, callable $loader, int $timeout=5000) |
| static | waitAll (int $timeout=5000) |
| static | waitForModule (string $module, int $timeout=5000) |
Static Private Attributes | |
| static | $enabled = false |
| static | $fibers = [] |
Class FiberModuleLoader
Manages true asynchronous module loading using PHP 8.1+ Fibers. Fibers provide lightweight pseudo-threading without race conditions.
Works with PHP 8.1+. Falls back gracefully if Fibers unavailable.
Definition at line 17 of file class.fibermoduleloader.php.
|
static |
Get fiber for a module (advanced usage)
| string | $module | Module name |
Definition at line 148 of file class.fibermoduleloader.php.
|
static |
Get all loaded modules
Definition at line 168 of file class.fibermoduleloader.php.
|
static |
Initialize Fiber module loader Checks if Fibers are available in this PHP version
Definition at line 28 of file class.fibermoduleloader.php.
References Log\warning().
Referenced by Root\register().
|
static |
Check if Fibers are available
Definition at line 158 of file class.fibermoduleloader.php.
Referenced by Root\ensureModuleLoaded().
|
static |
Check if a module is loaded
| string | $module | Module name |
Definition at line 118 of file class.fibermoduleloader.php.
|
static |
Check if a module is currently loading
| string | $module | Module name |
Definition at line 133 of file class.fibermoduleloader.php.
|
static |
Load module in a Fiber (true concurrent) Returns immediately; module loads in background
| string | $module | Module name |
| callable | $loader | Function that loads the module |
| int | $timeout | Maximum wait time if accessed before ready (ms) |
Definition at line 48 of file class.fibermoduleloader.php.
Referenced by Root\loadAppsFiber(), Root\loadHomepageFiber(), Root\loadRegistryFiber(), and Root\loadToolsFiber().
|
static |
Wait for all fibers to complete Useful for synchronization before proceeding
| int | $timeout | Maximum total wait time (ms) |
Definition at line 90 of file class.fibermoduleloader.php.
References Log\warning().
|
static |
Wait for a specific module to finish loading Blocks until module is ready or timeout expires
| string | $module | Module name |
| int | $timeout | Maximum wait time (ms) |
Definition at line 74 of file class.fibermoduleloader.php.
Referenced by Root\ensureModuleLoaded().
|
staticprivate |
Definition at line 20 of file class.fibermoduleloader.php.
Referenced by loadInFiber().
|
staticprivate |
Definition at line 19 of file class.fibermoduleloader.php.