Tcp.Dispatch (gt_bridge v0.19.2)

Copy Markdown View Source

I turn one decoded request frame into the reply frame for it.

I am transport-free on purpose: Tcp.Connection owns the socket, I own what a request means. The HTTP router still answers the same messages while both transports are live, so I mirror its session/stateless split exactly.

Summary

Functions

I answer request with the map to send back, or :no_reply when the request wants none.

Functions

reply_to(request)

@spec reply_to(map()) :: map() | :no_reply

I answer request with the map to send back, or :no_reply when the request wants none.

Every reply carries the id its request arrived with and the uniform type "EVAL" -- an answer for a command id -- so GT resolves the waiting promise no matter which channel asked. The request's own type routes what runs; only the value's encoding differs: an eval result is registered as a proxy, a completion list stays a plain list.