spawn

Function spawn 

Source
pub async fn spawn<L>(
    peer: Peer<L>,
    shutdown_rx: Receiver<()>,
) -> Result<(), PeerError>
where L: BucketLogProvider + Clone + Send + Sync + Debug + 'static, L::Error: Display + Error + Send + Sync + 'static,
Expand description

Spawn the peer with protocol router

This starts the iroh protocol router for handling incoming connections. The peer’s sync provider is responsible for managing its own background workers.

§Arguments

  • peer - The peer instance to run
  • shutdown_rx - Watch receiver for shutdown signal