class ConnectorTraverser extends ConnectorScheduler<IndexingConnectorContext> {

  @Override
  public synchronized void start() {
    super.start();

    ConnectorSchedule schedule = getConnectorSchedule();
    if (schedule.isRunOnce()) {
      // We do not launch TraverserWorkers in RunOnce mode
      traversers = Collections.emptyList();
    } else {
      List<TraverserWorker> traverserWorkers = new ArrayList<>();
      for (TraverserConfiguration configuration : context.getTraverserConfiguration()) {
        TraverserWorker traverser =
            TraverserWorkerManager.newWorker(
                configuration, context.getIndexingService(), getBackgroundExecutor());
        traverserWorkers.add(traverser);
        Runnable pollQueueRunnable =
            new BackgroundRunnable(
                new OneAtATimeRunnable(() -> traverser.poll(), traverser.getName()));
        getScheduledExecutor().scheduleAtFixedRate(
            pollQueueRunnable, 0, schedule.getPollQueueIntervalSecs(), TimeUnit.SECONDS);
      }
      traversers = Collections.unmodifiableList(traverserWorkers);
    }
  }

  private  ConnectorTraverser(Builder builder);

}