Skip to content

API Reference parrot_pipelines.planogram.perception.executor

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_pipelines.planogram.perception.executor

View source

Bounded, lifecycle-managed process executor for CPU-bound perception work (FEAT-574).

Class CpuExecutor

Lazily created, bounded ProcessPoolExecutor; one per PlanogramCompliance run.

Usage::

async with CpuExecutor(max_workers=2) as cpu:
    shapes = await cpu.run(propose_shapes, image, profiles)
Parameter Type Default Description
max_workers int 2 Upper bound of worker processes AND of in-flight submissions.

Method CpuExecutor.run

Run fn(*args) in a worker process and await its result.

fn must be module-level and picklable. Cancellation-safe: cancelling the awaiting coroutine releases its slot and leaves the executor usable.

run(fn: Callable[..., T], *args: Any) -> T

Parameter Type Default Description
fn Callable[..., T] Module-level, picklable callable.
*args Any () Positional arguments (picklable).

Returns: T — fn(*args).

Raises:

  • RuntimeError — The executor was closed.
  • BrokenProcessPool — A worker died; the pool is discarded and rebuilt on the next call.

Method CpuExecutor.aclose

Release the pool. Idempotent, non-blocking; queued work is cancelled.

aclose() -> None

Attribute T

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally