Question

I want the speed of asynchronous messages but still have some flow control. How can I accomplish this in Erlang?

Was it helpful?

Solution

There is no process memory limit right now -- it is discussed on mailing list etc. You can look at those threads.

On the up side, when you use OTP patterns implementation like gen_server you have a lot of freedom in retrieving messages from process queue and measuring the length of the queue.

gen_server2 used in rabbitmq used to optimize that by moving messages to internal data structure. Having that you can discard any new incoming message when internal queue is too long. You can do it silently or notify sender that the message rejected.

All of that is on very low level.

RabbitMQ will provide this functionality on AMQP level.

OTHER TIPS

A common and quite good way of enforcing flow control is to make well selected messages into calls which limits how much load each client can load the server to one, effectively providing force feed back in an extremely simple way. The trick is of course to pick which communications uses synchronous calls :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top