Skip to main content

Module in_process

Module in_process 

Source
Expand description

MACRO-2.B3 · the in-process transport.

A plexus_client::Transport that dispatches straight into an Activation — no socket, no server process, no runtime setup. It is the test double for a generated client, and the transport an activation author reaches for first.

§Why it lives here and not in plexus-client

plexus-client must build for wasm32-unknown-unknown, so it cannot depend on plexus-core. The dependency only runs one way — plexus-core → plexus-client — so the adapter that needs both lives on this side of the seam. The other transports follow the same rule: each lives where its dependencies do.

§The error layers, preserved

The transports are meant to be interchangeable, which means they must agree on which layer a failure belongs to — and over the wire a service answers a call it cannot dispatch with a typed error frame, not a broken connection (RETURNS-9):

FailureBecomesWhy
Activation::call returns Err(PlexusError)one error frame: RemoteError::from(&e), provenance the activation, not recoverable, no donewhat a service’s call route sends for the same failure — unknown method, missing or malformed param, scope gate denied — so a client sees ClientError::Remote(RemoteError) in-process exactly as it would over a socket
the stream contains a PlexusStreamItem::Errorthat framethe activation answered, and the answer is an error.
the MethodRef’s namespace is not this activation’sa TransportError (protocol)nothing was dispatched: the client was wired to the wrong transport, which no server would answer for.

§Not a way to skip the hub

DynamicHub applies the scope gate, provenance and credential-envelope assembly. This transport applies none of them: it is Activation::call and nothing else. Reaching for it outside a test is a smell: a program that imports a whole hub calls it through HubTransport (LOCAL-6).

Structs§

InProcessTransport
A Transport backed directly by one Activation.