[erlang-questions] limiting gen_server

Ulf Wiger ulf.wiger@REDACTED
Sun Aug 9 19:04:09 CEST 2009


Micha wrote:
> On Sunday, 9. August 2009 15:56:00 Ulf Wiger wrote:
>> These are not calls, though, at least not in the normal
>> gen_server vernacular. It is not really clear from this
>> snippet what you are trying to achieve, and what these
>> messages mean.
> 
> my gen_server get requests via udp and resolves them by asking another web 
> service. I would like to like it to some maximum of allowed simultanous 
> request (maybe 20, which should not happen btw.)
> 
> So I thought it would suffice to just wait some little time and send the request 
> again (to myself), in case the maximum is reached.

The main drawback with that solution, I guess, is that
the ordering of packets changes, but given that it's
UDP, ordering is undefined anyway. :)

This brings up another option - to simply let them drop,
by fetching one message at a time from the socket at
the pace that suits you.

BR,
Ulf W

-- 
Ulf Wiger
CTO, Erlang Training & Consulting Ltd
http://www.erlang-consulting.com


More information about the erlang-questions mailing list