protected ScheduledFuture<?> schedule(ScheduledFuture<?> current, Runnable task, long interval) {
        ScheduledExecutorService scheduler = getScheduler();
        if (scheduler == null || task == null || (current != null && !current.isDone() && !current.isCancelled())) {
            return null;
        }
        return interval < 1L ? scheduler.schedule(task, 0L, TimeUnit.MILLISECONDS)
                : scheduler.scheduleAtFixedRate(task, 0L, interval, TimeUnit.MILLISECONDS);
    }
Schedules the {@code task} to run only when {@code current} run has been
completed/cancelled or does not exist.

@param current  current task, which could be null or in running status
@param task     scheduled task to run
@param interval interval between each run
@return future object representing the scheduled task, could be null when no
        scheduler available({@link #getScheduler()} returns null)
clickhouse-client/src/main/java/com/clickhouse/client/ClickHouseLoadBalancingPolicy.java