class ReScheduleSupport {

    public synchronized void reschedulePoll(Function<MetricFilter, Object> function) {
        if (taskResults != null) {
            //end old schedule tasks
            for (TaskResult result : taskResults) {
                result.close();
            }
        }
        //start new schedule tasks
        Set<TaskResult> tasks = new HashSet<TaskResult>(3);
        tasks.add(schedulePoll(PRIORITY.NORMAL, config.stepMillis(PRIORITY.NORMAL),
            new PriorityMetricFilter(PRIORITY.NORMAL), function));
        tasks.add(schedulePoll(PRIORITY.HIGH, config.stepMillis(PRIORITY.HIGH),
            new PriorityMetricFilter(PRIORITY.HIGH), function));
        tasks.add(schedulePoll(PRIORITY.LOW, config.stepMillis(PRIORITY.LOW),
            new PriorityMetricFilter(PRIORITY.LOW), function));
        this.taskResults = tasks;
    }

    public  ReScheduleSupport(ScheduledService scheduler, LookoutConfig config, Clock clock);

}