@Override
  public void close() {
    try {
      for (var writer : writers) {
        var q = writer.writeBatchRef.get();
        if (q != null && !q.isEmpty()) {
          itemQueue.put(q);
        }
      }
      hasIncomingData = false;
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      throwFatalException(e);
    } catch (Exception e) {
      throwFatalException(e);
    }
  }
@param name     ID to prepend to stats generated about this queue
@param capacity maximum number of pending items that can be held in the queue
@param maxBatch batch size to buffer elements into before handing off to the blocking queue
@param stats    stats to monitor this with
planetiler-core/src/main/java/com/onthegomap/planetiler/worker/WorkQueue.java