Snakepit.Pool.Worker (snakepit v0.1.2)

GenServer that manages a single external process via Port using adapter pattern.

Each worker:

  • Owns one external process (Python, Node.js, etc.)
  • Handles request/response communication via adapter
  • Manages health checks
  • Reports metrics

Summary

Functions

Checks if a worker is busy.

Returns a specification to start this module under a supervisor.

Executes a command on the worker.

Gets worker statistics.

Starts a worker process.

Functions

busy?(worker_id)

Checks if a worker is busy.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

execute(worker_id, command, args, timeout \\ 30000)

Executes a command on the worker.

get_stats(worker_id)

Gets worker statistics.

start_link(opts)

Starts a worker process.