I'm writing http session manager (gen_server based). That server creates and removes session from in-memory storage. I need to remove expired session on timeout. I have two solutions:
- Create one timer to remove expired sessions from manager
- Create timer for each session
First solution locks server while all sessions are not processed (lock issue). Second solution takes process for each session (memory issue).
Question is which solution is right?
Thank you!