Canonical configuration for lifecycle-managed workers.
Pools assemble rich worker_config maps that flow through the worker
pipeline. The lifecycle manager only needs a stable subset of those values
to make recycling decisions and to start replacement workers. This module
normalizes that subset into a struct so the contract is explicit and tested.
Summary
Functions
Ensures lifecycle config is represented as a %LifecycleConfig{} struct.
Builds a worker_config map for a replacement worker using the canonical data.
Types
@type t() :: %Snakepit.Worker.LifecycleConfig{ adapter_args: list(), adapter_env: list(), adapter_module: module(), base_worker_config: map(), memory_threshold_mb: nil | pos_integer(), pool_identifier: atom() | nil, pool_name: term(), profile_module: module(), raw_worker_ttl: term(), worker_max_requests: :infinity | pos_integer(), worker_module: module(), worker_profile: atom() | module(), worker_ttl_seconds: :infinity | non_neg_integer() }
Functions
Ensures lifecycle config is represented as a %LifecycleConfig{} struct.
Accepts either an existing struct or a worker_config map. The optional
pool_name argument acts as a fallback when the map does not include one.
Builds a worker_config map for a replacement worker using the canonical data.