Snakepit.Pool.ProcessRegistry (Snakepit v0.6.10)
View SourceRegistry for tracking external worker processes with OS-level PID management.
This module maintains a mapping between:
- Worker IDs
- Elixir worker PIDs
- External process PIDs
- Process fingerprints
Enables robust orphaned process detection and cleanup.
Summary
Functions
Activates a reserved worker with its actual process information.
Returns a specification to start this module under a supervisor.
Cleans up dead worker entries from the registry.
Debug function to show all DETS entries with their BEAM run IDs.
Returns the number of entries currently stored in the DETS table.
Gets all active external process PIDs from registered workers.
Gets all registered external process PIDs, regardless of worker status.
Get the current BEAM run ID.
Gets registry statistics.
Gets information for a specific worker.
Gets workers with specific fingerprints.
Gets all registered worker information.
Manually trigger orphan cleanup. Useful for testing and debugging.
Registers a worker with its external process information. @deprecated Use reserve_worker/1 followed by activate_worker/4 instead
Reserves a worker slot before spawning the process. This ensures we can track the process even if we crash during spawn.
Unregisters a worker from tracking. Returns :ok regardless of whether the worker was registered.
Validates that all registered workers are still alive. Returns a list of dead workers that should be cleaned up.
Checks if a worker is currently registered.
Functions
Activates a reserved worker with its actual process information.
This is a synchronous call that blocks until the worker is registered. This ensures the happens-before relationship: worker registration completes before the worker is considered ready for work.
Returns a specification to start this module under a supervisor.
See Supervisor.
Cleans up dead worker entries from the registry.
Debug function to show all DETS entries with their BEAM run IDs.
Returns the number of entries currently stored in the DETS table.
Gets all active external process PIDs from registered workers.
Gets all registered external process PIDs, regardless of worker status.
This is useful during shutdown when workers may have been terminated but external processes still need cleanup.
Get the current BEAM run ID.
Gets registry statistics.
Gets information for a specific worker.
Gets workers with specific fingerprints.
Gets all registered worker information.
Manually trigger orphan cleanup. Useful for testing and debugging.
Registers a worker with its external process information. @deprecated Use reserve_worker/1 followed by activate_worker/4 instead
Reserves a worker slot before spawning the process. This ensures we can track the process even if we crash during spawn.
Unregisters a worker from tracking. Returns :ok regardless of whether the worker was registered.
Validates that all registered workers are still alive. Returns a list of dead workers that should be cleaned up.
Checks if a worker is currently registered.