[erlang-questions] How to put together gproc, hundreds of thousand of processes, timeouts?

Motiejus Jakštys desired.mta@REDACTED
Thu Nov 10 08:00:00 CET 2011


On Thu, Nov 10, 2011 at 09:36:17AM +0300, Max Bourinov wrote:
> Hello Erlangers!
> 
> I am developing back-end system which must be capable to serve many
> thousands of users and do the following:
> 
> 1. For each connected user it must create a separate gen_server process.
> 2. When any user interacts with the system its process gets messages.
> 3. When a user is idle for some while (5 minutes) its process triggers a
> timeout event.
> 
> So, all my processes lives in gproc. They are getting messages
> and everything seems to be fine.
> 
> I would like to know what is the best way to implement timeouts?

Have you tried gen_server timeout in call/cast return value?

Module:handle_call(Request, From, State) -> Result
Result = {reply,Reply,NewState} | {reply,Reply,NewState,Timeout}

Motiejus



More information about the erlang-questions mailing list