MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / from_config

Method from_config

crates/openshell-server/src/multiplex.rs:240–250  ·  view source on GitHub ↗
(config: &Config)

Source from the content-addressed store, hash-verified

238
239impl GrpcRateLimiter {
240 pub fn from_config(config: &Config) -> Option<Self> {
241 let (requests, window) = config.grpc_rate_limit()?;
242 Some(Self {
243 requests,
244 window,
245 state: Arc::new(Mutex::new(GrpcRateLimitState {
246 window_started: Instant::now(),
247 remaining: requests,
248 })),
249 })
250 }
251
252 fn allow(&self) -> bool {
253 let now = Instant::now();

Callers

nothing calls this directly

Calls 1

grpc_rate_limitMethod · 0.80

Tested by

no test coverage detected