Interface DoclingRequestExecutor

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DoclingRequestExecutor
Strategy that decides how DoclingDocumentParser invokes Docling to obtain a ProcessedDocumentResponse for a prepared DocumentRequest (the document source has already been injected into the request by the parser).

The default executor calls the asynchronous convert/chunk endpoints matching the request type; those endpoints already submit a task, poll for completion, and fetch the result on the common ForkJoinPool. Supplying a custom executor lets callers control exactly how Docling is called — for example to add retry or backoff, to run the blocking call on their own executor (such as the synchronous convert/chunk methods on a dedicated pool or virtual threads) instead of the common ForkJoinPool, or for fully custom orchestration. When a custom executor is supplied, the parser no longer restricts the request type or target, since the executor owns those semantics.

  • Method Summary

    Modifier and Type
    Method
    Description
    CompletionStage<? extends ai.docling.serve.api.response.ProcessedDocumentResponse>
    execute(ai.docling.serve.api.DoclingServeApi client, ai.docling.serve.api.request.DocumentRequest request)
    Invokes Docling for the given request.
  • Method Details

    • execute

      CompletionStage<? extends ai.docling.serve.api.response.ProcessedDocumentResponse> execute(ai.docling.serve.api.DoclingServeApi client, ai.docling.serve.api.request.DocumentRequest request)
      Invokes Docling for the given request.
      Parameters:
      client - the Docling client configured on the parser
      request - the request template with the document source already injected
      Returns:
      a stage that completes with the Docling response