Skip to content

Batch Operations

Demonstrates batch evaluation and execution — sending multiple requests in a single round-trip to reduce protocol overhead. Both PythonEmbed (single instance) and PythonEmbedPool support batch operations.

View source

Key Points

  • batchEval() evaluates multiple expressions in one MessagePack frame
  • batchExec() executes multiple statements in one round-trip
  • Pool batch operations return CompletableFuture<List<PythonValue>>
  • Timeout applies to the entire batch, not per-item

Run It

./gradlew :python-embed-examples:batch-operations:run