Skip to main content

Module SpawnBindTask

Module SpawnBindTask 

Source
Expand description

Spawn a detached tokio task that runs a tonic gRPC Router on the given address.

Lifted into the Vine crate so every embedder (Mountain’s MountainVinegRPCService, Air’s AirVinegRPCService, any Rust-side Cocoon client) shares one bind path with consistent dev-log instrumentation.

§Why a Router, not a Server builder

tonic’s Server::builder() returns a [tonic::transport::Server]. After the first .add_service(...) call you get a [tonic::transport::server::Router]. The Router type carries the generic stack of registered services, which is opaque to Vine - only the embedder knows the concrete service set. So Vine accepts a constructed Router and runs the boilerplate.

§Lifecycle

The serve future runs until either the OS socket closes or the tokio runtime shuts down. The task is detached; no JoinHandle is returned. Errors are logged via dev_log! and otherwise swallowed - the embedder decides whether to retry, restart, or fail loud via separate supervisory code.

Functions§

Fn
Spawn a detached tokio task that serves Router on Address.