<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Retry\Policy;

use PpPhp\Core\Platform\Event\Retry\Contracts\RetryPolicyInterface;
use PpPhp\Core\Platform\Event\Retry\RetryContext;

final class ImmediateRetryPolicy implements RetryPolicyInterface
{
    public function name(): string { return 'immediate'; }
    public function shouldRetry(RetryContext $context): bool { return $context->attempt() < $context->maxAttempts(); }
    public function nextDelaySeconds(RetryContext $context): int { return 0; }
}
