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

Method ServeOn

src/interface/aimrt_module_cpp_interface/context/context.h:531–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529// OpSrv::ServeOn implementation
530template <class Q, class P, concepts::SupportedServer<Q, P> TServer>
531void OpSrv::ServeOn(const res::Service<Q, P>& srv, aimrt::executor::ExecutorRef exe, TServer server) {
532 auto& rpc_ctx = ctx_.GetRpcResource(srv, loc_);
533
534 auto standardized_server = StandardizeServer<Q, P, TServer>(std::move(server));
535 auto ctx_ptr = ctx_.shared_from_this();
536
537 rpc_ctx.serve_f = Context::Server<Q, P>(
538 [server_func = std::move(standardized_server), exe = std::move(exe), ctx_ptr](
539 aimrt::rpc::ContextRef ctx, const Q& q, P& p) -> aimrt::co::Task<aimrt::rpc::Status> {
540 co_await aimrt::co::Schedule(aimrt::co::AimRTScheduler(exe));
541 ctx_ptr->LetMe();
542 co_return co_await server_func(ctx, q, p);
543 });
544}
545
546// OpSrv::Serving implementation
547template <class Q, class P>

Callers 1

InitializeMethod · 0.80

Calls 5

AimRTSchedulerClass · 0.85
GetCurrentContextFunction · 0.85
GetRpcResourceMethod · 0.80
LetMeMethod · 0.80
srvMethod · 0.80

Tested by

no test coverage detected