Files
logos-cpp-sdk/cpp
Igor SirotinandClaude Opus 4.7 d77c3dd616 fix: marshal provider events onto the source thread (#68)
* fix: marshal provider events onto the source thread

ModuleProxy's event listener emitted eventResponse directly on whatever thread
the module fired the event from (its worker/FFI thread). QtRemoteObjects then
serialized and sent the event from that foreign thread, racing the source
socket against a method reply being sent from the source thread, which silently
dropped the reply.

This is why a method that emits an event mid-call never returns to the caller
(e.g. delivery_module start(), which emits connectionStateChanged as the node
connects) while a method that emits nothing (createNode) returns fine.

Marshal the emission onto the ModuleProxy's own thread via a queued invocation
so events and method replies are serialized on the single thread
QtRemoteObjects expects to own the source.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: generalize the threading comment

* fix: use AutoConnection so same-thread emits stay synchronous

QueuedConnection deferred every emission, breaking same-thread callers that
emit-then-assert and crashing when a queued lambda outlived the object.
AutoConnection invokes synchronously when already on the source thread and only
queues cross-thread emissions (the actual fix); passing 'this' as context
cancels a queued call if the object is destroyed first.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 09:35:25 -04:00
..
2026-02-25 09:13:43 -05:00
2026-04-13 13:29:26 -04:00
2026-04-21 09:38:37 -04:00
2026-02-25 09:13:43 -05:00