void writeDocumentRemoval(DocumentId id, CompletionHandler completionHandler) throws IOException {
            writeDocument(myOut -> {
                try (JsonGenerator myJson = jsonFactory.createGenerator(myOut)) {
                    myJson.writeStartObject();
                    myJson.writeStringField("remove", id.toString());
                    myJson.writeEndObject();
                }
            }, completionHandler);
        }
Writes documents to an internal queue, which is flushed regularly.
vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java