<?php

declare(strict_types=1);

namespace App\Framework\CircuitBreaker\FailurePredicate;

use Throwable;

/**
 * Interface for determining if an exception should trigger circuit breaker failure
 */
interface FailurePredicate
{
    /**
     * Determine if the exception should trigger a circuit breaker failure
     */
    public function shouldTrigger(Throwable $exception, string $service): bool;

    /**
     * Get predicate identifier for logging/debugging
     */
    public function getIdentifier(): string;

    /**
     * Get human-readable description
     */
    public function getDescription(): string;
}
