문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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 :-)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top