public void flushExecutors() {
    for (PageSubscription cursor : activeCursors.values()) {
      cursor.flushExecutors();
    }

    Future future = new Future();

    executor.execute(future);

    while (!future.await(10000)) {
      log.warn("Waiting cursor provider " + this + " to finish executors " + executor);
    }
  }
 public void flushExecutors() {
   for (PageSubscription cursor : activeCursors.values()) {
     cursor.flushExecutors();
   }
   waitForFuture();
 }