[erlang-questions] Restricting number of executions per second

Bengt Kleberg <>
Wed Dec 3 15:13:25 CET 2008


One way to do it could be to add the frequency of calls to the server
state. Too high frequency => do not call the function.

On Wed, 2008-12-03 at 17:41 +0400, Ahmed Ali wrote:
> Hi All,
> I want to run a function in not more than a specific numbers of times
> per second (e.g. 3 times per second). The function is part of a
> gen_server process (i.e. called using gen_server:call/2). What's the
> best way to do this?
> The funny thing is that the first idea I got for a solution is locking
> n semaphores to serialize the execution. I guess I'm still locked in
> the mainstream paradigm :)
> Best regards,
> Ahmed
> _______________________________________________
> erlang-questions mailing list
> http://www.erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list