Weave Swarm
Events and Priority
Swarm::events() returns a Tokio broadcast receiver.
Workflow and current contract
Swarm::events() returns a Tokio broadcast receiver. Handle both received SwarmEvent values and receiver errors, including lagged messages or channel closure. The event enum includes connection lifecycle information; use the declared variant fields rather than assuming every event carries a complete peer record.
Priority types and the runtime's activation/resource limits govern scheduling. Transport scheduling is separate from application authorization. Preserve cancellation, deadlines, and connection shutdown when composing the runtime.
Source reference
eventsdeclarations —network/weave-swarm/src/events.rs.prioritydeclarations —network/weave-swarm/src/priority.rs.runtime::limitsdeclarations —network/weave-swarm/src/runtime/limits.rs.runtime::activationdeclarations —network/weave-swarm/src/runtime/activation.rs.