API Reference thrift_runtime v#0.7.0

View Source

Modules

High-level facade over the runtime codecs: two independent axes.

Listens on a port and starts a connection process per client.

Thrift binary protocol: value and message codecs as pure functions.

One connection to a Thrift server, as a gen_server.

Thrift compact protocol: value and message codecs as pure functions, wire-compatible with the Apache TCompactProtocol (the vendored 0.25.0 Erlang implementation is the golden reference).

One server-side connection: read message, dispatch, answer, repeat.

The runtime's observability callbacks: one on_event handler per client or server, no dependencies.

The bytes-level HTTP/1.1 subset the http transport needs.

The Apache Thrift JSON protocol: every value is a JSON document whose shape carries the Thrift types. A message is the array [1,"name",type,seqid,payload]; a struct is an object keyed by field id where every value is a one-key object naming the type ("i32", "str", "rec", ...); a list or set is ["i32",2,1,2], a map ["i32","i32",2,{"1":10}]. Wire-compatible with the vendored Apache thrift_json_protocol — the golden suite runs the official JSON client against a JSON server of ours.

The runtime's mirror of the generator's identifier derivation: a wire struct name becomes the snake-cased tag (InvoiceBankAccount -> invoice_bank_account) the runtime reaches for when a descriptor target declares no record tag of its own — map-mode __struct__ tags and hand-written descriptor targets.

EEP-79 native records for the representation axis (thrift_runtime:repr() value native).

The runtime's option surface in one place: defaults and typed getters.

Wire protocol behaviour: value and message codecs as pure functions.

One connection to a Thrift server with automatic reconnection and call statistics.

Representation engine: converts struct values between the wire representation (maps keyed by binary field names) and the in-process representations — driven purely by type descriptors.

Supervision root of a Thrift server: one acceptor, restartable.

Behaviour of a service description module.

Socket plumbing shared by the client and the server connection.

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