mod.rs 928 Bytes
Newer Older
1
2
3
4
5
//! Core abstractions for the SGLang router
//!
//! This module contains the fundamental types and traits used throughout the router:
//! - Worker trait and implementations
//! - Error types
6
//! - Circuit breaker for reliability
7
8
//! - Common utilities

9
pub mod circuit_breaker;
10
pub mod error;
11
pub mod retry;
12
pub mod token_bucket;
13
pub mod worker;
14
pub mod worker_registry;
15
16

// Re-export commonly used types at the module level
17
18
19
pub use circuit_breaker::{
    CircuitBreaker, CircuitBreakerConfig, CircuitBreakerStats, CircuitState,
};
20
pub use error::{WorkerError, WorkerResult};
21
pub use retry::{is_retryable_status, BackoffCalculator, RetryError, RetryExecutor};
22
pub use worker::{
23
24
    start_health_checker, BasicWorker, ConnectionMode, DPAwareWorker, HealthChecker, HealthConfig,
    Worker, WorkerCollection, WorkerFactory, WorkerLoadGuard, WorkerType,
25
};
26
pub use worker_registry::{WorkerId, WorkerRegistry, WorkerRegistryStats};