[erlang-questions] Disallowing gen_server:handle_cast() for a while?

Attila Rajmund Nohl <>
Thu Mar 3 10:57:26 CET 2011


2011/3/2, Nav <>:
> Hi,
>
> Is there a way to stop handle_cast(..) being called (i.e. stop
> gen_server from reading data from queue) for a while?
>
> I am trying to implement a logic, while processing, gen_server should
> not accept any messages and let messages stay in its queue. (Other
> processes can still send messages using gen_server:cast())

Why not do this processing in a handle_info? Trigger the calling of
the handle_info call by sending a message to the gen_server.


More information about the erlang-questions mailing list