pystamps.runtime.executor

HybridExecutor(io_workers=8, cpu_workers=0)

class HybridExecutor

  • io_workers and cpu_workers are normalized for pool sizing.
  • Context manager creates thread pool and lazily creates process pool.

Methods: __enter__, __exit__, submit(kind, fn, *args, **kwargs) -> Future.

submit(kind, fn, ...)

kind "io" submits to thread pool; "cpu" to process pool.

Exceptions: RuntimeError if executor is not started; ValueError for unknown kind.