pagination (skip, limit) ets items (gproc pids)

Pablo Platt pablo.platt@REDACTED
Sat Nov 20 01:18:52 CET 2010


Hi

I'm using gproc to save user sessions.
I want to present a list of online users in an admin html page.
I have a large number of sessions.
Is it possible to paginate the list similar to how SQL use skip and limit?
The admin will see a list of 1-10 online users and have links previous and next 
to see previous and next group of users.
I can't use ets continuation because I'll have to save it and reuse it which is 
hard in a website.

The only way I see to solve it is to use ets:match(Tab, Pattern, Limit) several 
times.
For example, if the admin requests for users 50-60 I'll do ets:match 5 times 
when using the returned continuation.

Is there a better way?
Is there a reason why Skip isn't implemented even if it'll be implemented like a 
suggested above?

Thanks


      


More information about the erlang-questions mailing list