Let's suppose that I have 2 processes in Erlang, and each process has a receive loop running. I want to send a signal from ProcessB to ProcessA but ProcessA doesn't actually need to do anything with it. ProcessA only needs to know that ProcessB sent the message.
Here's how I have it implemented currently:
receive
{message_from_process_b} ->
io:format("received a message from b", []);
end,
%% at this point I know that I've received the message from B.
It works fine. But out of curiosity, how can I write this without the io:format
line? (I need Process A to block until receiving the message from B, this is part of a larger Yaws / Yapp and the server needs a response before it can show the page.)