Ok, I will try to answer myself :)
There seems to be no direct translation of Erlang tuples into Thrift. What you can do is to include the type definitions created by Thrift in your Erlang module and write your Erlang code so that it uses the generated Erlang entries as parameters and / or returns values ββfor your functions.
Erlang atoms must be converted to Trrift binaries (or, ultimately, strings).
So, if you want to have something like:
-spec cool_function() -> {atom(), atom()}. cool_function() -> {foo, bar}
You need to specify what.thrift in your file:
struct MyTuple { 1: binary first, 2: binary second } service myService { MyTuple cool_function() }
In addition, you need to write your Erlang function as:
[...] -include("whatever_types.hrl"). [...] -spec cool_function() -> #myTuple{}. cool_function() -> #myTuple{ first = atom_to_binary(foo, utf8), second = atom_to_binary(bar, utf8) }.
Please correct me if I am wrong.
source share