morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
reply_router.hpp File Reference

The callId-multiplexed execute reply router, shared by every backend that talks to a RemoteServer over a real (or simulated) connection. More...

#include <cstddef>
#include <cstdint>
#include <functional>
#include <glaze/glaze.hpp>
#include <optional>
#include <unordered_map>
#include <utility>
#include "../wire.hpp"

Go to the source code of this file.

Detailed Description

The callId-multiplexed execute reply router, shared by every backend that talks to a RemoteServer over a real (or simulated) connection.

Two pieces live here, both extracted out of net::SocketBackend because they are a pure function of a decoded wire::Envelope and an in-memory map — no socket, no thread, no server — and so are worth testing directly rather than through a bound TCP port:

  • classifyExecuteReply — the ok/timeout/err triage. It had been open-coded three times (net/socket_backend.hpp, core/remote.hpp's SimulatedRemoteBackend, src/qt/ qt_websocket_backend.cpp) and the Qt copy had already drifted to a hand-typed "timeout" literal, which is exactly the drift wire::kExecuteTimeoutMessage exists to prevent.
  • PendingCallTable — call-id allocation plus the pending-completion map, owned by the backend's I/O loop.
Why core/detail/ and not net/detail/
core/remote.hpp is one of the consumers and ships in the base morph target's installed header set, whereas everything under include/morph/ net/ belongs to the optional morph_net target (MORPH_BUILD_NET, default OFF). A core/ header including a net/ one would therefore install a remote.hpp that cannot find its own include whenever net is off. Living under core/detail/ keeps the dependency pointing the one direction it already points (net → core).

Definition in file reply_router.hpp.