Expand description
Centralized endpoint registry for service discovery.
This module provides:
EndpointModefor determining transport type (inproc, ipc, tcp)SocketKindfor identifying RPC socket types (implements Hash)EndpointRegistryfor service endpoint management (supports multiple socket types)ServiceRegistrationRAII guard for automatic cleanup
§Usage
ⓘ
use hyprstream_rpc::registry::{init, global, EndpointMode, SocketKind, ServiceRegistration};
// Initialize at startup
init(EndpointMode::Ipc, Some(runtime_dir));
// Services self-register (single endpoint, backward compatible)
let _reg = ServiceRegistration::new("policy", endpoint, None)?;
// Services with multiple endpoints
let _reg = ServiceRegistration::multi("model", vec![
(SocketKind::Rep, rep_endpoint),
(SocketKind::Quic, quic_endpoint),
], None)?;
// Clients discover local endpoints by socket type
let rep_endpoint = global().endpoint("model", SocketKind::Rep);
let quic_endpoint = global().try_endpoint("model", SocketKind::Quic)?;Structs§
- Endpoint
Registry - Centralized endpoint registry with self-registration.
- IpcResolver
- Explicit IPC resolver profile.
- Local
Inproc Resolver - Explicit single-process resolver profile.
- Service
Entry - Service registration entry with multiple endpoints by socket type.
- Service
Registration - RAII guard for service registration.
Enums§
- Endpoint
Mode - Endpoint mode determines default transport type.
- Socket
Kind - Socket type identifier for endpoint registration.
Functions§
- global
- Get the global registry.
- init
- Initialize the global endpoint registry.
- shutdown
- Shutdown the global registry.
- try_
global - Try to get the global registry (non-panicking).