[erlang-questions] gen_tcp nonblocking send

Daniel Ginsburg <>
Thu May 1 12:42:24 CEST 2008


On 01.05.2008 14:20 Per Hedeland wrote:

> I think this fits a common Erlang solution: "use another process".
> I.e. have a separate "sender" process that just does the potentially
> blocking gen_tcp:send(), ack'ing back to the "real" sender when it
> returns. The "real", intelligent sender will send messages to this
> process instead of calling gen_tcp:send() directly, and when it has sent
> a message and not yet received the corresponding ack, it must go into
> "intelligent queuing mode", where it buffers updates and eliminates
> obsoleted ones. Implementing this in Erlang is simpler than describing
> it.:-)
> 

Yeah, this is what I figured when I woke up this morning. I'm hacking on 
it right now.

Thanks for the kind advice. Indeed, Erlang's answer to any problem - 
just spawn yet another process :)

-- 
dg



More information about the erlang-questions mailing list