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

Method call

crates/openshell-server/src/multiplex.rs:348–370  ·  view source on GitHub ↗
(&mut self, req: Request<B>)

Source from the content-addressed store, hash-verified

346 }
347
348 fn call(&mut self, req: Request<B>) -> Self::Future {
349 // If `poll_ready` short-circuited an exhausted limiter, it never polled
350 // the inner service to readiness. Honor that decision regardless of the
351 // limiter's current state (the window may have rolled over since): the
352 // Tower contract forbids forwarding to an inner service that did not
353 // report readiness.
354 if std::mem::take(&mut self.rate_limited) {
355 let response =
356 tonic::Status::resource_exhausted("gRPC rate limit exceeded").into_http();
357 return Box::pin(async move { Ok(response) });
358 }
359 if self
360 .limiter
361 .as_ref()
362 .is_some_and(|limiter| !limiter.allow())
363 {
364 let response =
365 tonic::Status::resource_exhausted("gRPC rate limit exceeded").into_http();
366 return Box::pin(async move { Ok(response) });
367 }
368 let future = self.inner.call(req);
369 Box::pin(future)
370 }
371}
372
373/// Combined gRPC service that routes between `OpenShell` and Inference services

Calls 15

status_responseFunction · 0.85
is_user_callableFunction · 0.85
grpc_method_from_pathFunction · 0.85
BoxBodyClass · 0.85
normalize_http_pathFunction · 0.85
allowMethod · 0.80
pathMethod · 0.80
checkMethod · 0.80
into_partsMethod · 0.80

Tested by

no test coverage detected