[Seaside] How to get the number of user connected
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.
(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
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
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 ?
William Harford wrote:
> (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
> On Dec 12, 2006, at 10:31 AM, Florian Minjat wrote:
>> 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 ?
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
Seaside mailing list
Seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Seaside