pub async fn spawn(
cfg: SwimConfig,
local_id: NodeId,
local_addr: SocketAddr,
seeds: Vec<SocketAddr>,
transport: Arc<dyn Transport>,
) -> Result<SwimHandle, SwimError>Expand description
Bring up a SWIM failure detector.
cfg— validatedSwimConfig. An invalid config returnsSwimError::InvalidConfigbefore any task is spawned.local_id— this node’s canonical id.local_addr— the socket address the transport is already bound to. The membership list stores it verbatim for peers to echo back in probe responses.seeds— initial peer addresses. Empty list is legal and yields a solo-cluster detector that does nothing interesting until a peer arrives via an external join.transport— anyTransportimpl (UDP in production, the in-memory fabric in tests).