1

If I have a BERT-RPC Server (Ernie) on one machine, and would like to communicate with it from an Erlang/OTP application from another machine, what would be the best course? Is There an Erlang BERT-RPC Client?

I suppose it wouldn't be too much trouble to send and receive messages via gen_tcp, but is there an existing, stable application for this already?

1 Answers1

2

We run a simple gen_server using gen_tcp to handle incoming bert requests from Rails apps. Somewhere in there you find something like:

handle_info({tcp, Socket, RawData}, State) ->
    Data = bert:decode(RawData),
    do_bert_crap(Data),
    ...
    gen_tcp:send(Socket, bert:encode({reply, whatever})),
    {noreply, State}.

We don't handle many requests this way. This is used internally only.

Edit: We use bert.erl for (de-)serialization.

Tilman
  • 2,015
  • 14
  • 16
  • What about {active, false} version? I've read that {active, true} may be vulnerable on huge traffic, because it makes messages. – desudesudesu Jan 18 '13 at 11:57