Skip to main content

Module worker_pool

Module worker_pool 

Source
Expand description

Provides the worker_pool module.

§Examples

ⓘ
use pharos_runtime_core::worker_pool;
  • crate for sibling modules in the same crate. Bounded native worker-pool primitives for runtime request orchestration.

The pool owns its channel and worker joins, rejects work after shutdown, and never uses an unbounded queue or an unsafe FFI bridge.

Structs§

WorkerPool
A bounded worker pool that executes an owned callback for each item.

Enums§

WorkerPoolError
Errors returned by bounded worker-pool lifecycle operations.

Constants§

MAX_QUEUE_CAPACITY 🔒
MAX_WORKERS 🔒
PHAROS_NATIVE_WORK_QUEUE_BYTES_PER_SLOT
Approximate queue-memory accounting unit used for bounded work sizing.

Functions§

worker_pool_destroy
Destroys a string worker pool after joining its workers.
worker_pool_enqueue
Enqueues one string request and fails when the bounded queue is closed.
worker_pool_init
Creates the native string-work worker pool with bounded resources.
worker_pool_join
Joins every worker after shutdown.
worker_pool_request_shutdown
Requests shutdown of a string worker pool.
worker_pool_thread_main
Executes one worker thread main-loop with bounded recv polling and cooperative shutdown.