mod.rs 813 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
14
15
pub mod worker;

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