Skip to content

Pool Async

Demonstrates PythonEmbedPool — auto-scaling pool with async CompletableFuture API. Shows pool builder configuration, async eval/exec/batchEval, pool monitoring, and parallel execution.

View source

Key Points

  • PythonEmbedPool.builder() fluent configuration: min/max pool, idle timeout
  • Async API: all methods return CompletableFuture
  • pool.eval() / pool.exec() — async evaluation/execution
  • pool.batchEval() — async batch evaluation
  • Pool monitoring: size(), activeCount(), minPool(), maxPool()
  • Parallel execution — multiple concurrent requests handled simultaneously

Run It

./gradlew :python-embed-examples:pool-async:run