loadFromConfig method
void
loadFromConfig()
Loads queue configuration from the application's config.
This method reads queue settings from the configuration and automatically registers the appropriate queue drivers based on the configuration.
The configuration should have the following structure:
queue:
default: memory
drivers:
memory:
driver: memory
file:
driver: file
path: ./storage/queue
Throws QueueException if the configuration is invalid or if a driver cannot be initialized.
Implementation
void loadFromConfig() {
_configLoader.loadFromConfig(_config, _registry);
// Update default driver after config loading
try {
_defaultDriver = _registry.getDefaultDriver();
_defaultDriverName = _registry.getDefaultDriverName();
} catch (e) {
// Keep existing driver if config loading fails
}
}