[erlang-questions] Blocking send to port

2 views
Skip to first unread message

tsuraan

unread,
Mar 16, 2009, 11:05:54 PM3/16/09
to EQ Questions
I have a program that wants to receive a constant stream of bytes on
stdin so that it can forward them to an icecast server. Is there any
way that the erlang process sending the data to that port program can
block on writes (port_command calls), allowing me to write a really
simple process that just gets data from its source and sends it to the
port program at exactly the same rate that the port program consumes
the data?
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://www.erlang.org/mailman/listinfo/erlang-questions

Jachym Holecek

unread,
Mar 17, 2009, 6:13:33 AM3/17/09
to tsuraan, EQ Questions
# tsuraan 2009-03-17:

> I have a program that wants to receive a constant stream of bytes on
> stdin so that it can forward them to an icecast server. Is there any
> way that the erlang process sending the data to that port program can
> block on writes (port_command calls), allowing me to write a really
> simple process that just gets data from its source and sends it to the
> port program at exactly the same rate that the port program consumes
> the data?

Have the port program acknowledge incoming data via stdout after it
has forwarded them to icecast server?

HTH,
-- Jachym

Reply all
Reply to author
Forward
0 new messages