@insler/rpc/transport-memory
The in-process transport — the dev/test default, shipped inside the umbrella deliberately (zero external dependencies, batteries included).
import { createMemoryTransport } from '@insler/rpc/transport-memory';
const { bus, client, host } = createMemoryTransport();MemoryBusroutes requests byservice.methodkey. Duplicate registration for a key throws; invoking an unknown key returns a__not_found__error response.MemoryClientTransport/MemoryHostTransportimplement theClientTransport/HostTransportinterfaces over a shared bus.createMemoryTransport()returns a connected{ bus, client, host }triple.
When to use it
Section titled “When to use it”- Tests — directly, or via the higher-level
TestHost.pair/ServiceTest.pairhelpers that wrap it. - Local development — run a service and its callers in one process.
- Monolith mode — run multiple services in one process by sharing a
single
MemoryBus.
Values pass in-process, so there is no serde here by design — when you need wire encoding, that is the NATS adapter’s job. Streaming behavior over a real wire is observably identical to this transport for the same call: develop on memory, deploy on NATS.