erlang - how to limit message queue or emulate it?
Right now I am doing Process ! Message, but as i googled a bit, a message queue size is only limited to memory. I have a tree of processes where leaves generate messages and feed up to the root and i need to limit queue or switch to some another method of doing the same. more of it, sometimes Process gets messages from one leaf and sometimes from two leaves. In the second case I need different finite queues for eave leaf. There are no built-in mechanisms to limit the size of the message queue for a process. The usual solution to this problem in erlang is to introduce a flow control protocol