erlang: used erlang message queue semantics to simplify channel implementation