retry example


    public static function retryable(Connection $connection, \Closure $closure)
    {
        return self::retry($connection$closure, 0);
    }

    /** * @template TReturn of mixed * * @param \Closure(Connection): TReturn $closure The function to execute transactionally. * * @return TReturn */
    private static function retry(Connection $connection, \Closure $closure, int $counter)
    {
        
public function __construct(
        private readonly ?Connection $connection,
        private readonly Statement $query
    ) {
    }

    /** * @param array<string, mixed> $params */
    public function execute(array $params = []): int
    {
        return self::retry($this->connection, fn () => $this->query->executeStatement($params), 0);
    }

    /** * @template TReturn of mixed * * @param \Closure(): TReturn $closure * * @return TReturn */
    public static function retryable(Connection $connection, \Closure $closure)
    {
        
Home | Imprint | This part of the site doesn't use cookies.