[router] Expose worker startup secs & Return error instead of panic for router init (#3016)
This commit is contained in:
@@ -17,6 +17,7 @@ class Router:
|
||||
- PolicyType.CacheAware: Distribute requests based on cache state and load balance
|
||||
host: Host address to bind the router server. Default: '127.0.0.1'
|
||||
port: Port number to bind the router server. Default: 3001
|
||||
worker_startup_timeout_secs: Timeout in seconds for worker startup. Default: 300
|
||||
cache_threshold: Cache threshold (0.0-1.0) for cache-aware routing. Routes to cached worker
|
||||
if the match rate exceeds threshold, otherwise routes to the worker with the smallest
|
||||
tree. Default: 0.5
|
||||
@@ -37,6 +38,7 @@ class Router:
|
||||
policy: PolicyType = PolicyType.RoundRobin,
|
||||
host: str = "127.0.0.1",
|
||||
port: int = 3001,
|
||||
worker_startup_timeout_secs: int = 300,
|
||||
cache_threshold: float = 0.50,
|
||||
balance_abs_threshold: int = 32,
|
||||
balance_rel_threshold: float = 1.0001,
|
||||
@@ -50,6 +52,7 @@ class Router:
|
||||
policy=policy,
|
||||
host=host,
|
||||
port=port,
|
||||
worker_startup_timeout_secs=worker_startup_timeout_secs,
|
||||
cache_threshold=cache_threshold,
|
||||
balance_abs_threshold=balance_abs_threshold,
|
||||
balance_rel_threshold=balance_rel_threshold,
|
||||
|
||||
Reference in New Issue
Block a user