Expand description
§Vine::Server
Server-side gRPC scaffolding shared by every embedder that hosts a Vine
service: Mountain (MountainService), Air (AirService), and Rust-side
Cocoon. The pieces below are the boilerplate every bind site needs;
concrete service implementations stay in their owning crate.
§Modules
Constants- default ports / timeouts / message-size cap.ValidateSocketAddress- port-and-format pre-flight check.SpawnBindTask- detachedtokio::spawnthat runsRouter::serve(Address)until process termination.SpawnBindTaskWithShutdown- same shape but takes a shutdown future so daemons can drain in-flight calls before exit.Notification- one-entry-point-per-file Cocoon → Mountain notification handlers dispatched againstcrate::Host::VineHost.
§Embedder call pattern
ⓘ
use Vine::Server::{Constants, SpawnBindTask, ValidateSocketAddress};
let Address = ValidateSocketAddress::Fn("[::1]:50051", "MountainService")?;
let Service = MyMountainServiceImpl::new(state);
let Wrapped = MountainServiceServer::new(Service)
.max_decoding_message_size(Constants::MAX_MESSAGE_SIZE)
.max_encoding_message_size(Constants::MAX_MESSAGE_SIZE);
let Router = tonic::transport::Server::builder().add_service(Wrapped);
SpawnBindTask::Fn("MountainService".to_string(), Address, Router);Modules§
- Constants
- Default configuration constants for Vine gRPC servers.
- Notification
- Vine::Server::Notification
- Spawn
Bind Task - Spawn a detached tokio task that runs a tonic gRPC
Routeron the given address. - Spawn
Bind Task With Shutdown - Spawn a detached tokio task that serves a tonic gRPC
Routerwith graceful shutdown signalling. - Validate
Socket Address - Validate a socket address string before binding.