public function run(callable $action)
    {
        $retryCount = 0;
        $lastException = null;

        do {
            try {
                return $action();
            } catch (Exception $e) {
                $lastException = $e;
                if (!$this->strategy->shouldRetry($e, $retryCount)) {
                    throw $e;
                }
            }
        } while ($this->retries > $retryCount++);

        if ($lastException !== null) {
            throw $lastException;
        }
    }