Quantcast

Erlang with Thrift

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Erlang with Thrift

Mike Oxford
Thrift's RPC mechanism is very one-way.

Is anyone pipelining the Thift protocol over erlang sockets?  I cannot seem to find any examples via Google.

Thanks!
-mox

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Erlang with Thrift

Garrett Smith-5
On Mon, May 23, 2011 at 1:44 PM, Mike Oxford <[hidden email]> wrote:
> Thrift's RPC mechanism is very one-way.
> Is anyone pipelining the Thift protocol over erlang sockets?  I cannot seem
> to find any examples via Google.

As in sending Thrift encoded payload as messages in distributed Erlang?

If you can get away from Thrift (e.g. no one else is relying on it or
you can't talk them off the cliff) I'd stick Erlang terms. BERT is a
decent way to let other languages play along, otherwise there are
usually language specific Erlang term conversion libraries.

If you're locked into Thrift, the Erlang bindings work fine for
encoding and decoding terms as per the Thrift docs. You need to dig
into the code for these modules: thrift_memory_buffer,
thrift_binary_protocol/thrift_protocol, and thrift_transport. Examples
for other languages should translate directly to those.

Garrett
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Erlang with Thrift

Jack Moffitt
> If you can get away from Thrift (e.g. no one else is relying on it or
> you can't talk them off the cliff) I'd stick Erlang terms. BERT is a
> decent way to let other languages play along, otherwise there are
> usually language specific Erlang term conversion libraries.

Speaking of BERT, how are people dealing with the possibility that
rogue/broken clients might fill up the atom table?

jack.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Erlang with Thrift

Geoff Cant-2

On 2011-05-23, at 15:51 , Jack Moffitt wrote:

>> If you can get away from Thrift (e.g. no one else is relying on it or
>> you can't talk them off the cliff) I'd stick Erlang terms. BERT is a
>> decent way to let other languages play along, otherwise there are
>> usually language specific Erlang term conversion libraries.
>
> Speaking of BERT, how are people dealing with the possibility that
> rogue/broken clients might fill up the atom table?
>
> jack.
>

The ngmoco bert-rpc server (ngbs) uses the 'safe' option to binary_to_term to avoid this problem: https://github.com/ngmoco/ngbs/blob/master/src/ngbs_bert.erl#L21 . Clients get a protocol/data error if they try to do this.

The trade-off is that you then need to ensure that all the modules for your application are loaded before you start accepting Bert requests, as [safe] decoding will stop modules from being automatically loaded.

ngbs has been stable in production use for six months or so, and recently got request evaluation timing support which has been useful for spotting latency problems in the exposed APIs. I'd be happy to answer questions about ngbs off-list too.

Cheers,
--
Geoff Cant




_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Erlang with Thrift

Mike Oxford
In reply to this post by Jack Moffitt
On Mon, May 23, 2011 at 3:51 PM, Jack Moffitt <[hidden email]> wrote:
> If you can get away from Thrift (e.g. no one else is relying on it or
> you can't talk them off the cliff) I'd stick Erlang terms. BERT is a
> decent way to let other languages play along, otherwise there are
> usually language specific Erlang term conversion libraries.

Speaking of BERT, how are people dealing with the possibility that
rogue/broken clients might fill up the atom table?

jack.

Not use atoms anywhere in the protocol?

-mox

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Erlang with Thrift

Norton Joseph Wayne
In reply to this post by Mike Oxford

Mox -

There is a Thrift encoder/decoder over TCP/IP implemented as part of the  
UBF framework.

https://github.com/norton/ubf-thrift

The mapping between Thrift, UBF, and erlang terms is illustrated in this  
file:

https://github.com/norton/ubf-thrift/blob/master/src/tbf.erl

If you want any further examples or help, please feel free to contact me  
directly.

thanks,

On Tue, 24 May 2011 03:44:59 +0900, Mike Oxford <[hidden email]> wrote:

> Thrift's RPC mechanism is very one-way.
>
> Is anyone pipelining the Thift protocol over erlang sockets?  I cannot  
> seem
> to find any examples via Google.
>
> Thanks!
> -mox


--
[hidden email]
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...