thrift_runtime_transport (thrift_runtime v0.7.0)

View Source

Send-side framing shared by the connection and the client.

Both endpoints used to carry the same case Transport of shape on every send; this module is the one copy. It is deliberately thin — the receive side goes through thrift_runtime_socket:extract_message/4 (and thrift_runtime_http for HTTP), and the process skeletons around both directions stay in their gen_servers because their error policies genuinely differ.

Summary

Functions

Frames an encoded message for the client-to-server direction.

Frames an encoded message for the server-to-client direction.

Functions

client_frame/4

-spec client_frame(thrift_runtime_socket:transport(), iodata(), Host :: binary(), Path :: binary()) ->
                      iodata().

Frames an encoded message for the client-to-server direction.

Host and Path are the HTTP request-line ingredients; other transports ignore them.

server_frame/2

-spec server_frame(thrift_runtime_socket:transport(), iodata()) -> iodata().

Frames an encoded message for the server-to-client direction.

framed prefixes a big-endian i32 length, buffered sends the message as is, and http answers one request with one 200 response whose body carries the message — HTTP is request/response even for oneways.