refactor(logging, queue): replace RedisQueue with FileQueue for async logging
- Update `LoggerInitializer` to use `FileQueue` instead of `RedisQueue` for async logging, improving local file-based queuing. - Remove unused `RedisQueue` and related Redis configurations. - Modify `createQueue` to accept `PathProvider` for file path resolution. - Revise `AGENTS.md` to add detailed AI agent usage and updated guidelines. - Refactor `ComponentRegistryInitializer` to use explicit dependency injection for `__invoke` method, ensuring cleaner and more maintainable initialization logic.
This commit is contained in:
@@ -17,19 +17,19 @@ final readonly class ComponentRegistryInitializer
|
||||
{
|
||||
public function __construct(
|
||||
private Container $container,
|
||||
private DiscoveryRegistry $discoveryRegistry
|
||||
private DiscoveryRegistry $discoveryRegistry,
|
||||
) {
|
||||
}
|
||||
|
||||
#[Initializer]
|
||||
public function __invoke(): ComponentRegistryInterface
|
||||
public function __invoke(
|
||||
LiveComponentRenderer $renderer,
|
||||
ComponentCacheManager $cacheManager,
|
||||
LiveComponentHandler $handler,
|
||||
ComponentMetaDataCache $metadataCache,
|
||||
NestedPerformanceTracker $performanceTracker
|
||||
): ComponentRegistryInterface
|
||||
{
|
||||
$renderer = $this->container->get(LiveComponentRenderer::class);
|
||||
$cacheManager = $this->container->get(ComponentCacheManager::class);
|
||||
$handler = $this->container->get(LiveComponentHandler::class);
|
||||
$metadataCache = $this->container->get(ComponentMetadataCache::class);
|
||||
$performanceTracker = $this->container->get(NestedPerformanceTracker::class);
|
||||
|
||||
// DebugPanel is optional
|
||||
$debugPanel = null;
|
||||
|
||||
@@ -39,7 +39,7 @@ final readonly class ComponentRegistryInitializer
|
||||
// DebugPanel not available, that's okay
|
||||
}
|
||||
|
||||
$registry = new ComponentRegistry(
|
||||
return new ComponentRegistry(
|
||||
container: $this->container,
|
||||
discoveryRegistry: $this->discoveryRegistry,
|
||||
renderer: $renderer,
|
||||
@@ -49,10 +49,5 @@ final readonly class ComponentRegistryInitializer
|
||||
performanceTracker: $performanceTracker,
|
||||
debugPanel: $debugPanel
|
||||
);
|
||||
|
||||
// Register as interface
|
||||
$this->container->singleton(ComponentRegistryInterface::class, $registry);
|
||||
|
||||
return $registry;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user