【发布时间】:2014-09-17 02:22:06
【问题描述】:
我想以{From(PID}, atom} 格式从python 向Erlang 传递消息,因为我的erlang 程序需要知道要向哪个进程ID 发送消息。
Erlang 消息循环:
message_loop([First | Rest]) ->
receive
{From, ready} ->
% From ! {self(), {read, First}},
python:cast(From, {read, First}),
message_loop(Rest);
{From, done} ->
python:cast(From, {read, First}),
message_loop(Rest);
{From, _} ->
io:format("Invalid Message Received From");
_ ->
io:format("Random Message")
end.
如何使用 ErlPort 传递这样的消息?或者在产生许多进程后,我可以使用任何其他技术来选择性地与进程通信吗?
【问题讨论】:
-
您阅读文档erlport.org/docs/python.html 了吗?有效果吗?