iroh icon indicating copy to clipboard operation
iroh copied to clipboard

(iroh-net) Manage tasks for `Discovery::publish` in `MagicEndpoint`

Open Frando opened this issue 1 year ago • 0 comments

Discovery::publish is currently a one-off sync function calls and async publish impls are expected to start their own task with tokio::task::spawn. This means those tasks cannot be aborted when the magic endpoint shuts down. Instead we should either pass a cancellation token or a JoinSet to spawn tasks into.

See also this discussion: https://github.com/n0-computer/iroh/pull/2056#discussion_r1511535760

Frando avatar Mar 11 '24 14:03 Frando