Skip to main content

Module server

Module server 

Source
Expand description

Broker server foundation for running-process-broker-v1.

Phase 4 (#235) grows this module into the pipe accept loop, service definition loader, backend registry, admin verbs, and perf guard. The first slice keeps the core Hello validation and negotiation logic testable without binding sockets or spawning backends.

Re-exports§

pub use admin::handle_admin_connection;
pub use admin::serve_one_admin_socket;
pub use admin::AdminBackend;
pub use admin::AdminConnectionError;
pub use admin::AdminFrameError;
pub use admin::AdminInodePressure;
pub use admin::AdminSnapshot;
pub use admin::AdminSpawnBudget;
pub use admin::ADMIN_PAYLOAD_PROTOCOL;
pub use admin::ADMIN_SCHEMA_VERSION;
pub use backend_endpoint_allocator::BackendEndpointAllocator;
pub use backend_endpoint_allocator::BackendEndpointAllocatorError;
pub use backend_endpoint_allocator::DEFAULT_BACKEND_ENDPOINT_ATTEMPTS;
pub use backend_launcher::BackendLaunchError;
pub use backend_launcher::BackendLaunchRequest;
pub use backend_launcher::BackendLauncher;
pub use backend_launcher::CommandBackendLauncher;
pub use backend_launcher::BACKEND_ENV_ENDPOINT_NAMESPACE;
pub use backend_launcher::BACKEND_ENV_ENDPOINT_PATH;
pub use backend_launcher::BACKEND_ENV_INSTANCE;
pub use backend_launcher::BACKEND_ENV_SERVICE_NAME;
pub use backend_launcher::BACKEND_ENV_SERVICE_VERSION;
pub use backend_launcher::BACKEND_ENV_TRACEPARENT;
pub use backend_launcher::BACKEND_ENV_TRACESTATE;
pub use backend_registry::BackendKey;
pub use backend_registry::BackendRegistry;
pub use broadcast::BroadcastAck;
pub use broadcast::BroadcastBackend;
pub use broadcast::BroadcastBackendResponse;
pub use broadcast::BroadcastFailure;
pub use broadcast::BroadcastFailureReason;
pub use broadcast::BroadcastOperation;
pub use broadcast::BroadcastPolicy;
pub use broadcast::BroadcastResult;
pub use broadcast::BroadcastTimeout;
pub use broadcast::LifecycleBroadcastModel;
pub use broadcast::QuiesceReason;
pub use broadcast::DEFAULT_BROADCAST_ACK_TIMEOUT;
pub use connection::handle_hello_connection;
pub use connection::handle_hello_connection_with;
pub use connection::handle_hello_connection_with_peer_policy;
pub use connection::local_socket_name;
pub use connection::serve_local_socket_connections;
pub use connection::serve_local_socket_connections_with;
pub use connection::serve_local_socket_connections_with_peer_policy;
pub use connection::serve_local_socket_connections_with_policy;
pub use connection::serve_one_local_socket;
pub use connection::serve_one_local_socket_with;
pub use connection::serve_one_local_socket_with_peer_policy;
pub use connection::BrokerConnectionError;
pub use connection::HelloResponder;
pub use connection::PeerCredentialPolicy;
pub use control_socket::handle_control_connection_with_peer_policy;
pub use control_socket::handle_control_connection_with_peer_policy_and_fd_guard;
pub use control_socket::serve_control_socket_connections_with_limit_and_policy;
pub use control_socket::serve_control_socket_connections_with_limit_policy_and_post_hello;
pub use control_socket::serve_control_socket_connections_with_limit_policy_post_hello_and_fd_guard;
pub use control_socket::serve_control_socket_connections_with_policy;
pub use control_socket::ControlSocketConnectionLimit;
pub use control_socket::ControlSocketError;
pub use control_socket::ControlSocketReply;
pub use fd_pressure::fd_exhaustion_error_for_tests;
pub use fd_pressure::is_fd_exhaustion_error;
pub use fd_pressure::FdPressureConfig;
pub use fd_pressure::FdPressureDecision;
pub use fd_pressure::FdPressureGuard;
pub use fd_pressure::DEFAULT_FD_PRESSURE_RECOVERY_ACCEPTS;
pub use fd_pressure::DEFAULT_FD_PRESSURE_RETRY_AFTER_MS;
pub use handoff::AcknowledgedHandoff;
pub use handoff::ExpiredHandoff;
pub use handoff::HandoffAckError;
pub use handoff::HandoffAckRegistry;
pub use handoff::HandoffAttemptDecision;
pub use handoff::HandoffAttemptFailure;
pub use handoff::HandoffAttemptInputs;
pub use handoff::HandoffFallbackDecision;
pub use handoff::HandoffFallbackPolicy;
pub use handoff::HandoffFallbackReason;
pub use handoff::HandoffFallbackState;
pub use handoff::HandoffToken;
pub use handoff::HandoffTokenError;
pub use handoff::HandoffTokenStore;
pub use handoff::HandoffTokenStoreConfig;
pub use handoff::PendingHandoffBackend;
pub use handoff::PendingHandoffOverflow;
pub use handoff::PendingHandoffQueue;
pub use handoff::PendingHandoffQueueConfig;
pub use handoff::DEFAULT_HANDOFF_ACK_DEADLINE;
pub use handoff::DEFAULT_HANDOFF_FAILED_ATTEMPTS_PER_WINDOW;
pub use handoff::DEFAULT_HANDOFF_FAILED_ATTEMPT_WINDOW;
pub use handoff::DEFAULT_HANDOFF_TOKEN_COLLISION_ATTEMPTS;
pub use handoff::DEFAULT_HANDOFF_TOKEN_TTL;
pub use handoff::DEFAULT_MAX_PENDING_HANDOFFS;
pub use handoff::DEFAULT_MAX_PENDING_HANDOFF_TOKENS;
pub use handoff::DEFAULT_PENDING_HANDOFF_TTL;
pub use handoff::HANDOFF_TOKEN_BYTES;
pub use handoff_serve::complete_negotiated_handoff;
pub use handoff_serve::ServeHandoffContext;
pub use hello_handler::HelloHandler;
pub use hello_handler::HelloHandlerError;
pub use hello_handler::HelloRequest;
pub use hello_handler::PeerIdentity;
pub use hello_handler::RegisteredBackend;
pub use hello_router::HelloRouter;
pub use idle_coord::BackendIdleCoordinator;
pub use idle_coord::BackendIdleDue;
pub use idle_coord::BackendIdlePolicy;
pub use idle_coord::DEFAULT_BACKEND_IDLE_TIMEOUT;
pub use instance::BrokerInstanceError;
pub use instance::BrokerInstanceKey;
pub use perf_guard::enforce_hello_latency_budget;
pub use perf_guard::summarize_hello_latencies;
pub use perf_guard::HelloLatencySummary;
pub use perf_guard::PerfGuardError;
pub use perf_guard::HELLO_P50_BUDGET;
pub use perf_guard::HELLO_P99_BUDGET;
pub use perf_guard::HELLO_PERF_GUARD_ENV;
pub use perf_guard::HELLO_PERF_SAMPLE_COUNT;
pub use recovery::BackendRecoveryDecision;
pub use recovery::BackendRecoveryPolicy;
pub use recovery::BackendRecoveryRefusalReason;
pub use recovery::BackendRecoveryState;
pub use recovery::DEFAULT_RECOVERY_BUDGET_WINDOW;
pub use recovery::DEFAULT_RECOVERY_RETRY_BACKOFF;
pub use serve::build_hello_handler;
pub use serve::serve_launching_backends;
pub use serve::serve_launching_backends_with_launcher;
pub use serve::serve_registered_backend;
pub use serve::BrokerLaunchServeConfig;
pub use serve::BrokerServeConfig;
pub use serve::BrokerServeError;
pub use service_def_loader::ensure_service_definition_dir;
pub use service_def_loader::service_definition_dir;
pub use service_def_loader::service_definition_path;
pub use service_def_loader::validate_service_definition_for_service;
pub use service_def_loader::write_service_definition;
pub use service_def_loader::ServiceDefinitionError;
pub use service_def_loader::ServiceDefinitionLoader;
pub use service_def_loader::SERVICE_DEF_DIR_ENV;
pub use service_def_loader::SERVICE_DEF_EXTENSION;
pub use spawn_coordinator::acquire_spawn_lock;
pub use spawn_coordinator::SpawnBeginError;
pub use spawn_coordinator::SpawnBudgetConfig;
pub use spawn_coordinator::SpawnBudgetSnapshot;
pub use spawn_coordinator::SpawnCoordinator;
pub use spawn_coordinator::SpawnLockError;
pub use spawn_coordinator::SpawnLockFileIdentity;
pub use spawn_coordinator::SpawnLockGuard;
pub use spawn_coordinator::SpawnOutcome;
pub use spawn_coordinator::SpawnPermit;
pub use spawn_coordinator::DEFAULT_SPAWN_ATTEMPTS_PER_WINDOW;
pub use spawn_coordinator::DEFAULT_SPAWN_BUDGET_WINDOW;
pub use spawn_wait::SpawnWaitDecision;
pub use spawn_wait::SpawnWaitPolicy;
pub use spawn_wait::SpawnWaitProbe;
pub use spawn_wait::DEFAULT_SPAWN_WAIT_HARD_CEILING;
pub use spawn_wait::SPAWN_WAIT_BACKOFF_SEQUENCE;
pub use trace_context::TraceContext;
pub use version_allow_list::check_version_allowed;
pub use version_allow_list::VersionPolicyBlock;

Modules§

admin
Admin verb rendering for the v1 broker.
backend_endpoint_allocator
Backend endpoint allocation for broker-managed daemon spawns.
backend_launcher
Backend launch abstraction for Hello registry misses.
backend_registry
Verified backend registry keyed by broker instance, service, and version.
broadcast
Backend lifecycle broadcast model.
connection
Framed broker connection handling for the v1 Hello path.
control_socket
Shared broker control socket dispatch for Hello and admin frames.
fd_pressure
FD-pressure self-demotion for the broker accept path (#390).
handoff
Handoff scaffolding for the optional Phase 6 handle-passing path.
handoff_serve
Serve-side wiring of the handle-passing handoff into the production broker accept loop (#387).
hello_handler
Hello validation and in-memory negotiation.
hello_router
Service-definition-backed Hello routing.
idle_coord
Broker-side backend idle coordination model.
instance
Broker instance routing for service definitions.
metrics
Frozen OpenMetrics names for the v1 broker.
perf_guard
Hello latency budget enforcement for the v1 broker.
recovery
Backend crash recovery policy for broker-managed services.
serve
Broker serve-mode wiring for registered and launch-backed backends.
service_def_loader
Service-definition file loading for the v1 broker.
spawn_coordinator
Spawn coordination contract for broker-managed backends.
spawn_wait
Adaptive spawn-wait timing model for broker-managed backends.
trace_context
Trace context captured from the v1 broker frame.
version_allow_list
Version floor and allow-list enforcement for service definitions.