MCPcopy Create free account
hub / github.com/AimRT/AimRT / Serving

Method Serving

src/interface/aimrt_module_cpp_interface/context/context.h:548–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546// OpSrv::Serving implementation
547template <class Q, class P>
548aimrt::co::Task<aimrt::rpc::Status> OpSrv::Serving(const res::Service<Q, P>& srv, aimrt::rpc::ContextRef ctx, const Q& q, P& p) {
549 details::GetCurrentContext(loc_)->LetMe();
550 auto& rpc_ctx = ctx_.GetRpcResource(srv, loc_);
551
552 if (!rpc_ctx.serve_f.has_value()) {
553 co_return aimrt::rpc::Status(AIMRT_RPC_STATUS_SVR_NOT_IMPLEMENTED);
554 }
555
556 if (!ctx_.Running() || ctx_.GetSrvState() != context::RpcState::kOn) [[unlikely]] {
557 ctx_.log().Trace("Server is not ready to serve.");
558 co_return aimrt::rpc::Status(AIMRT_RPC_STATUS_SVR_NOT_READY);
559 }
560
561 co_return co_await std::any_cast<Context::Server<Q, P>&>(rpc_ctx.serve_f)(ctx, q, p);
562}
563
564// OpSrv::StandardizeServer implementation
565template <class Q, class P, concepts::SupportedServer<Q, P> Func>

Callers

nothing calls this directly

Calls 8

GetCurrentContextFunction · 0.85
StatusClass · 0.85
LetMeMethod · 0.80
GetRpcResourceMethod · 0.80
RunningMethod · 0.80
GetSrvStateMethod · 0.80
TraceMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected