Expand description
§Initialize (Vine Server)
Contains the logic to initialize and start the Mountain gRPC server.
This module provides the entry point for starting Vine’s gRPC servers:
- MountainServiceServer: Listens for connections from Cocoon sidecar
- CocoonServiceServer: Listens for connections from Mountain (bidirectional)
§Initialization Process
- Validates socket addresses
- Retrieves ApplicationRunTime from Tauri state
- Creates service implementations with runtime dependencies
- Spawns server tasks as background tokio tasks
- Servers begin listening on specified ports
§Server Configuration
- Mountaln Service: Typically on port 50051 (configurable)
- Cocoon Service: Typically on port 50052 (configurable)
- Both servers support compression and message size limits
§Error Handling
Initialization failures are logged and returned to the caller. Once started, servers run independently and log their own errors.
§Lifecycle
Servers run as detached tokio tasks. They will:
- Start immediately when spawned
- Continue until process termination or tokio runtime shutdown
- Log errors to the logging system
- Not automatically restart on failure (caller should implement retry logic if needed)
Modules§
- Server
Config 🔒 - Server configuration constants
Functions§
- Initialize
- Initializes and starts the gRPC servers on background tasks.
- Validate
Socket 🔒Address - Validates a socket address string before parsing.