Files
logos-protocol/cpp
Dario LipicarandClaude Opus 5 dcc0f73d1c feat: hold a CALL until its module is reachable (whenObjectAvailable) (#53)
* feat: add whenObjectAvailable(), the call-path counterpart of onEventWhenAvailable()

Event subscribers got a way to ask "tell me when this module is reachable"
without blocking and without giving up on the first no. Callers had no such
thing, so a caller facing the same startup race had only two bad options: fail
fast, which strands a UI that will never retry, or call straight through and sit
in the transport's acquire timeout on whatever thread it was called from — the
GUI thread, in practice.

whenObjectAvailable() reuses the pending-subscription registry that already
exists, as a readiness-only entry: it attaches no subscription, fires its
callback exactly once, and is then forgotten rather than being re-armed on
reconnect, because a one-shot readiness answer that arrives twice is not an
answer. It shares the registry's timer, backoff and diagnostics, so it costs
nothing new on qt_remote and shows up in pendingSubscriptions() as
"<object>::(readiness)" while it waits.

Its first consumer is LogosQmlBridge::callModuleAsync, which can now hold a call
issued before its module exists and dispatch it when the module appears.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(events): pin whenObjectAvailable on every transport

It shares the pending registry with event subscriptions but answers a different
question, and it had coverage only end-to-end through the QML bridge. Three
cases x 6 params: fires true for a module that is already up; holds rather than
answering "not reachable" for one that is merely not up YET, then fires exactly
once when it appears; and is NOT resurrected by a reconnect.

That last one is the asymmetry worth pinning. Event subscriptions ARE re-armed
across a reconnect on purpose; a readiness answer already delivered is spent,
and re-firing it would re-dispatch whatever call it was gating.

Suite 356 -> 374.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 14:09:25 -03:00
..