grpoc for session management

Pablo Platt pablo.platt@REDACTED
Tue Feb 9 17:52:47 CET 2010


I'm building a simple comet chat server.
Each user can have several resource each represented by a process.
Each incoming message should be sent to all online resources of a user.

There are two scenarios in which I need to find a process:
1. message is directed to:user_id
2. incoming message contain a session_id

Is it better to have a unique name per user_id+resource and then use gproc:select to find the pids of the resources
or to use a property user_id and then find all the pids that have this property.

I think I need a unique name session_id in addition to that.

Is it better to use gen_fsm(to handle auth for example) for each process or a simple process?

Will gproc support global scope in the near future?



More information about the erlang-questions mailing list