When one API call needs the result of another, a client typically waits for the first response before sending the next request. This library lets the client express that dependency in a typed pipeline. The server executes the sequence using the application’s existing schemas and handlers.
Two lookups in one round trip
In this example, the profile lookup requires a user ID. The pipeline passes the ID directly from the user handler to the profile handler on the server.
Sequential · 2 network round trips
- Fetch userAsk the server for the user.
- Receive user IDRead the ID from the response.
- Fetch profileSend the ID in a second request.
Pipelined · 1 network round trip
- Send both callsSpecify that the second call needs the ID from the first.
- Resolve on the serverThe profile handler gets the user ID.
- Return selected fieldsRead the requested fields in one response.
A pipeline can include independent calls as well. Each handler still controls its own database access, so developers can batch database reads separately.