@@ -568,7 +568,7 @@ template <typename Client>
568568void clientDestroy (Client& client)
569569{
570570 if (client.m_context .connection ) {
571- client.m_context .connection -> m_loop . log () << " IPC client destroy " << typeid (client).name ();
571+ client.m_context .loop -> log () << " IPC client destroy " << typeid (client).name ();
572572 } else {
573573 KJ_LOG (INFO, " IPC interrupted client destroy" , typeid (client).name ());
574574 }
@@ -577,7 +577,7 @@ void clientDestroy(Client& client)
577577template <typename Server>
578578void serverDestroy (Server& server)
579579{
580- server.m_context .connection -> m_loop . log () << " IPC server destroy " << typeid (server).name ();
580+ server.m_context .loop -> log () << " IPC server destroy " << typeid (server).name ();
581581}
582582
583583// ! Entry point called by generated client code that looks like:
@@ -597,7 +597,7 @@ void clientInvoke(ProxyClient& proxy_client, const GetRequest& get_request, Fiel
597597 }
598598 if (!g_thread_context.waiter ) {
599599 assert (g_thread_context.thread_name .empty ());
600- g_thread_context.thread_name = ThreadName (proxy_client.m_context .connection -> m_loop . m_exe_name );
600+ g_thread_context.thread_name = ThreadName (proxy_client.m_context .loop -> m_exe_name );
601601 // If next assert triggers, it means clientInvoke is being called from
602602 // the capnp event loop thread. This can happen when a ProxyServer
603603 // method implementation that runs synchronously on the event loop
@@ -608,26 +608,26 @@ void clientInvoke(ProxyClient& proxy_client, const GetRequest& get_request, Fiel
608608 // declaration so the server method runs in a dedicated thread.
609609 assert (!g_thread_context.loop_thread );
610610 g_thread_context.waiter = std::make_unique<Waiter>();
611- proxy_client.m_context .connection -> m_loop . logPlain ()
611+ proxy_client.m_context .loop -> logPlain ()
612612 << " {" << g_thread_context.thread_name
613613 << " } IPC client first request from current thread, constructing waiter" ;
614614 }
615615 ClientInvokeContext invoke_context{*proxy_client.m_context .connection , g_thread_context};
616616 std::exception_ptr exception;
617617 std::string kj_exception;
618618 bool done = false ;
619- proxy_client.m_context .connection -> m_loop . sync ([&]() {
619+ proxy_client.m_context .loop -> sync ([&]() {
620620 auto request = (proxy_client.m_client .*get_request)(nullptr );
621621 using Request = CapRequestTraits<decltype (request)>;
622622 using FieldList = typename ProxyClientMethodTraits<typename Request::Params>::Fields;
623623 IterateFields ().handleChain (invoke_context, request, FieldList (), typename FieldObjs::BuildParams{&fields}...);
624- proxy_client.m_context .connection -> m_loop . logPlain ()
624+ proxy_client.m_context .loop -> logPlain ()
625625 << " {" << invoke_context.thread_context .thread_name << " } IPC client send "
626626 << TypeName<typename Request::Params>() << " " << LogEscape (request.toString ());
627627
628- proxy_client.m_context .connection -> m_loop . m_task_set ->add (request.send ().then (
628+ proxy_client.m_context .loop -> m_task_set ->add (request.send ().then (
629629 [&](::capnp::Response<typename Request::Results>&& response) {
630- proxy_client.m_context .connection -> m_loop . logPlain ()
630+ proxy_client.m_context .loop -> logPlain ()
631631 << " {" << invoke_context.thread_context .thread_name << " } IPC client recv "
632632 << TypeName<typename Request::Results>() << " " << LogEscape (response.toString ());
633633 try {
@@ -642,7 +642,7 @@ void clientInvoke(ProxyClient& proxy_client, const GetRequest& get_request, Fiel
642642 },
643643 [&](const ::kj::Exception& e) {
644644 kj_exception = kj::str (" kj::Exception: " , e).cStr ();
645- proxy_client.m_context .connection -> m_loop . logPlain ()
645+ proxy_client.m_context .loop -> logPlain ()
646646 << " {" << invoke_context.thread_context .thread_name << " } IPC client exception " << kj_exception;
647647 const std::unique_lock<std::mutex> lock (invoke_context.thread_context .waiter ->m_mutex );
648648 done = true ;
@@ -653,7 +653,7 @@ void clientInvoke(ProxyClient& proxy_client, const GetRequest& get_request, Fiel
653653 std::unique_lock<std::mutex> lock (invoke_context.thread_context .waiter ->m_mutex );
654654 invoke_context.thread_context .waiter ->wait (lock, [&done]() { return done; });
655655 if (exception) std::rethrow_exception (exception);
656- if (!kj_exception.empty ()) proxy_client.m_context .connection -> m_loop . raise () << kj_exception;
656+ if (!kj_exception.empty ()) proxy_client.m_context .loop -> raise () << kj_exception;
657657}
658658
659659// ! Invoke callable `fn()` that may return void. If it does return void, replace
@@ -687,7 +687,7 @@ kj::Promise<void> serverInvoke(Server& server, CallContext& call_context, Fn fn)
687687 using Results = typename decltype (call_context.getResults ())::Builds;
688688
689689 int req = ++server_reqs;
690- server.m_context .connection -> m_loop . log () << " IPC server recv request #" << req << " "
690+ server.m_context .loop -> log () << " IPC server recv request #" << req << " "
691691 << TypeName<typename Params::Reads>() << " " << LogEscape (params.toString ());
692692
693693 try {
@@ -704,14 +704,14 @@ kj::Promise<void> serverInvoke(Server& server, CallContext& call_context, Fn fn)
704704 return ReplaceVoid ([&]() { return fn.invoke (server_context, ArgList ()); },
705705 [&]() { return kj::Promise<CallContext>(kj::mv (call_context)); })
706706 .then ([&server, req](CallContext call_context) {
707- server.m_context .connection -> m_loop . log () << " IPC server send response #" << req << " " << TypeName<Results>()
707+ server.m_context .loop -> log () << " IPC server send response #" << req << " " << TypeName<Results>()
708708 << " " << LogEscape (call_context.getResults ().toString ());
709709 });
710710 } catch (const std::exception& e) {
711- server.m_context .connection -> m_loop . log () << " IPC server unhandled exception: " << e.what ();
711+ server.m_context .loop -> log () << " IPC server unhandled exception: " << e.what ();
712712 throw ;
713713 } catch (...) {
714- server.m_context .connection -> m_loop . log () << " IPC server unhandled exception" ;
714+ server.m_context .loop -> log () << " IPC server unhandled exception" ;
715715 throw ;
716716 }
717717}
0 commit comments