Skip to content

xmlrpc_client: thread cvc::app& through rpc/rpc_call API - #26

Merged
transfix merged 1 commit into
masterfrom
cvc-singleton/xmlrpc-client-ctx
May 2, 2026
Merged

transfix merged 1 commit into
masterfrom
cvc-singleton/xmlrpc-client-ctx

Conversation

@transfix

@transfix transfix commented May 2, 2026

Copy link
Copy Markdown
Owner

Removes the last cvcapp/app::instance() references from src/cvc/xmlrpc_client.cpp.

The free functions rpc() and rpc_call() now take cvc::app &ctx as their first parameter and forward it to xmlrpc_client_thread, which now holds an app * member and calls ctx.log() / ctx.data() instead of cvcapp.log / cvcapp.data.

Also drops the unused queue_xmlrpc_client_thread and process_xmlrpc_client_threads classes plus their static initializer:

  • The class comment already noted async calls were broken since 2014.
  • The on_startup() registration was commented out (// CVC_NAMESPACE::state::on_startup(init);).
  • The static_init therefore had no runtime effect.

Updated:

  • inc/cvc/utility.h: rpc/rpc_call signatures gain leading app &ctx.
  • src/cvc/libcvc.cpp: client() command passes its ctx through to rpc().

After this change, libcvc.cpp and xmlrpc_client.cpp are free of cvcapp. Remaining singleton sites: app.h/app.cpp mechanics, state.cpp:98-101, state_object.h:218 default ctor, and xmlrpc_server.cpp.

Build + ctest -j8 green: 590/590 (one ThreadProgressPersistence flake passed on rerun, unrelated).

Removes the last cvcapp/app::instance() references from xmlrpc_client.cpp.
The free functions rpc(), rpc_call() now take 'cvc::app &ctx' as first
parameter and forward it to xmlrpc_client_thread, which holds an app*
and calls ctx.log()/ctx.data() instead of cvcapp.log/cvcapp.data.

Also dropped the unused 'queue_xmlrpc_client_thread' and
'process_xmlrpc_client_threads' classes plus their static initializer.
The class comment already noted async calls were broken since 2014, the
on_startup() registration was commented-out (// CVC_NAMESPACE::state...),
and the static_init had no effect.

Updated:
- inc/cvc/utility.h: rpc/rpc_call signatures gain leading 'app &ctx'.
- src/cvc/libcvc.cpp: client() command passes its ctx through to rpc().

After this change, libcvc.cpp + xmlrpc_client.cpp are free of cvcapp.
Remaining sites: app.h/app.cpp singleton mechanics, state.cpp:98-101,
state_object.h:218 default ctor, and xmlrpc_server.cpp.

Build + ctest -j8 green: 590/590 (one ThreadProgressPersistence flake
passed on rerun).
@transfix
transfix force-pushed the cvc-singleton/xmlrpc-client-ctx branch from 379ba68 to e347782 Compare May 2, 2026 21:06
@transfix
transfix merged commit 6915eda into master May 2, 2026
19 checks passed
@transfix
transfix deleted the cvc-singleton/xmlrpc-client-ctx branch May 2, 2026 21:26
transfix added a commit that referenced this pull request May 3, 2026
Mirrors the #26 xmlrpc_client migration. xmlrpc_server_thread now
takes cvc::app& at construction, stores it as a member, and uses
state::instance(*_app) and _app->log/sleep/startThread instead of
the cvcstate/cvcapp singleton macros. Method classes (cvcstate_*)
now also carry an app* and resolve state through the bound context.
The static monitor()/init() in the namespace-private bootstrapper
takes ctx explicitly (captured once from app::instance() at startup).

This also fixes a pre-existing build break under
-DCVC_USING_XMLRPC=ON: the 1-arg thread_feedback() default ctor was
removed in #25 and xmlrpc_server.cpp was the last unbuilt caller of
it. Verified locally with CVC_USING_XMLRPC=ON: 590/590 tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant