Behaviour for pool adapters.
init/2 runs once per {shard, role} pool (at boot and on add_shard),
never on the routing path. It returns:
:state- adapter state passed torun/2:ref- the value handed to callers (Shardex.ref/3):child_spec- how to start the pool (anySupervisor.child_spec/2input), ornilwhen the pool is managed elsewhere:meta- adapter-specific info exposed on%Shardex.Pool{}
run/2 wraps a call in adapter context (e.g. Ecto's put_dynamic_repo).
Default: fun.(ref).
Pool process names should be built with Module.concat([instance, shard, role]).
Summary
Types
@type init_result() :: %{ :state => term(), :ref => term(), optional(:child_spec) => Supervisor.module_spec() | Supervisor.child_spec() | nil, optional(:meta) => map() }