<div>Hi,</div>
<div> </div>
<div>I need to implement a queue service that has a capacity. This means that the `in` actions has to be able to block the producer when the queue is full, and also the `out` action has to be able to block the consumer when the queue is empty.</div>
<div> </div>
<div>Sending in an item and then receiving with "after infinity" in the producer seems to be a working approach. But my concern is that this way the producer process is blocked and so it is unable to respond to any system messages. If I do this in a supervised process, do I break the contract between OTP and that process? Aren't all the processes supposed to answer certain low level messages that is handled by gen_server without me to even know about? Shouldn't supervised processes be blocked only in the gen_server's main receive loop?</div>
<div> </div>
<div>I feel that receiving indefinitely is something I should avoid. But how can I implement the queue in an OTP friendly way?</div>
<div> </div>
<div>S.</div>
<div> </div>