Local Calls and Network Service Calls
A local call shares the caller's runtime context. A network call adds a transport, another process, and additional ways to wait or fail.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
Trace a lookup
A local catalogue function can access in-memory records. A remote service can accept the same conceptual query, but its response must cross a network. Client and server roles define the endpoints.
Design for an incomplete observation
The caller can stop waiting without learning whether remote work finished. Remote call and retry semantics explain why a local function's assumptions may fail across that boundary.[1]
Draw what can fail after execution starts
A local lookup can return a value or raise within one process. A similar service call serializes inputs and sends them over a connection. The server may finish after the caller loses its connection, leaving the caller uncertain. See missing replies.
Local boundary: arguments → function → result
Remote boundary: encode → send → receive → execute → reply → decode
Lost reply can occur after execution
Test a contract at its actual boundary
Mocking a remote service as an ordinary function can hide deadlines and duplicate delivery. Test a denied request, delayed reply and successful result using a controlled endpoint. Carry a stable request identifier if later reconciliation requires it.