[Seaside] How to get the number of user connected

Boris Popov boris at deepcovelabs.com
Wed Dec 13 16:11:01 UTC 2006


Or you could create your own session subclass and store your user there, which should make other things easier as well.

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: seaside-bounces at lists.squeakfoundation.org <seaside-bounces at lists.squeakfoundation.org>
To: William Harford <seaside at harford.org>
Cc: The Squeak Enterprise Aubergines Server - general discussion. <seaside at lists.squeakfoundation.org>
Sent: Wed Dec 13 02:36:50 2006
Subject: Re: [Seaside] How to get the number of user connected

Thanks again for your answer.
It works fine and answer me the number of active sessions for a given 
application.
The problem is that I'd like to count the active users logged in. And 
there could be several sessions by user. So I'll need to get to the 
WAComponent of my application and test the name of the user.
I just manage to do that quickly with the session like this :

self state objects keysDo: [:k | (k class == MyComponent) ifTrue: [^ k 
user]]

But this is ugly because I needed to define WASession>>state and 
WAStateRegistry>>object to access the state. Is there any 'clean' way 
to get to the application state from its session ?

Florian Minjat

William Harford wrote:
> Florian,
> 
> (WASession allSubInstances select:[ :ea | ea isActive]) size
> 
> Will get you the total number of active sessions for all session. I 
> think something like ...
> 
> (WASession allSubInstances select:
>     [ :ea | ea isActive & (ea application name = "whatever" ) ]) size
> 
> Will get you what you want.
> 
> I have not tried the above but it should be close enough to get you 
> started.
> 
> Will
> 
> On Dec 12, 2006, at 10:31 AM, Florian Minjat wrote:
> 
>> Hi,
>>   I'd like to display on my seaside application the number of users 
>> currently connected to a particular application. I know I have to get 
>> some info from the sessions. But with a quick look into the code I 
>> could'nt manage to see how I could do that.
>>   Any hint ?
>>
>> Florian
>> _______________________________________________
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> 
_______________________________________________
Seaside mailing list
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20061213/1576ecb6/attachment.htm


More information about the Seaside mailing list