<?php

declare(strict_types=1);

namespace App\Framework\CircuitBreaker\Registry;

/**
 * Interface for discovering and managing services in circuit breaker namespaces
 */
interface ServiceRegistry
{
    /**
     * Discover all services in a given namespace
     */
    public function discoverServices(string $namespace): array;

    /**
     * Register a service in a namespace
     */
    public function registerService(string $service, string $namespace): void;

    /**
     * Unregister a service from a namespace
     */
    public function unregisterService(string $service, string $namespace): void;

    /**
     * Check if a service is registered in a namespace
     */
    public function isServiceRegistered(string $service, string $namespace): bool;

    /**
     * Get all registered namespaces
     */
    public function getNamespaces(): array;

    /**
     * Get all services across all namespaces
     */
    public function getAllServices(): array;

    /**
     * Clear all registered services in a namespace
     */
    public function clearNamespace(string $namespace): void;

    /**
     * Clear all registered services
     */
    public function clearAll(): void;
}
