[erlang-questions] Asynchronous calls in gen_server
Mihai Balea
mihai@REDACTED
Wed Nov 9 05:09:48 CET 2011
On Nov 8, 2011, at 9:55 PM, Andrew Berman wrote:
> How does it determine in which order to process those calls?
In the order they are received.
> Does it store the messages somewhere to be processed by the function at a later time?
Messages are regular Erlang messages, they are stored in the gen_server process' message mailbox. There is no special queue that stores these messages (with standard OTP behaviors - I believe third party behaviors such as gen_server2 do have an explicit message queue)
> Does it just reject those calls it doesn't have the bandwidth to process?
No. Messages will accumulate in the mailbox leading to degraded performance. This is a well known failure mode in erlang applications.
> How are async calls different than say using something like RabbitMQ where I could post to a RabbitMQ queue and have some external application process what is in that queue?
Can't really compare the two, they're different concepts, designed for different purposes
> Assuming it does use some sort of queue, is there a way to store messages across restarts or crashes?
No
Hope this helps
Mihai
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111108/db532427/attachment.htm>
More information about the erlang-questions
mailing list