Skip to main content

Module Server

Module Server 

Source
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

§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
SpawnBindTask
Spawn a detached tokio task that runs a tonic gRPC Router on the given address.
SpawnBindTaskWithShutdown
Spawn a detached tokio task that serves a tonic gRPC Router with graceful shutdown signalling.
ValidateSocketAddress
Validate a socket address string before binding.