Hi Adam,
If I understood correctly your question, there are two points there:
1. how you can replicate a message;
2. how you can be sure that the message is received.
If that is the case, here are few simple answers (hopefully, more skilled Erlang users will come with better ideas/solutions):
1. Take a look at gproc or any equivalent implementation.
2. That depends on how the message is sent, but the general solution is to have a reply from the receiver. Here are two simple solutions for doing that:
a) Message sent via threads messaging (Pid ! MyMessage):
-> sender: ReceiverPid ! {self(), MyMessage}
-> receiver listener (basics only):
receive
Message -> {SenderPid, SenderMessage} = Message, SenderPid ! received
...
end
or you can add SenderPid in the group of receivers.
b) Message sent via TCP connection (for the receiver only; the sender should have also a listener to be able to receive the answer):
listen_socket(Socket) ->
case gen_tcp:recv(Socket, 0) of
{ok,Data} ->
gen_tcp:send(Socket,<<"received">>),
listen_socket(Socket);
...
end.
These are only few basic options. Of course, there are many other options (e.g., monitoring your receiver). I resume my answer to a simple one. Take care of the length of the queue (if you need a personalized queue, I suggest gen_fsm).
I hope this answer helps and if I misunderstood your problem, I kindly ask you to ignore my answer.
CGS