code: @Override
      public void close() {
          stopRunnable();
          try {
              batchService.awaitTermination(MAX_VALUE, MILLISECONDS);
          } catch (InterruptedException e) {
              throw new RuntimeException(e);
          }
  
          handler.shutdown();
          try {
              handler.awaitTermination(MAX_VALUE, MILLISECONDS);
          } catch (InterruptedException e) {
              throw new RuntimeException(e);
          }
      }
docs: {@inheritDoc}