[Seaside] How to get the number of user connected

Florian Minjat florian.minjat at emn.fr
Mon Dec 18 08:02:09 UTC 2006


Thanks again for your answers, I will try it when I find some time to 
spare.
Florian

Ramon Leon wrote:
>> Currently I use the default behavior for session expiration. 
>> So they just wait to be GCed. Is there an existing 'session 
>> reaper' available somewhere or should I make it myself? It 
>> doesn't seems to difficult, but I dislike coding the wheel again.
>>
>> Thanks again,
>>
>> Florian Minjat
>> _______________________________________________
>> Seaside mailing list
>> Seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> I actually subclass ApplicationService and run a separate background process
> to expire sessions.  Here's a fileOut of what I use.
> 
> 'From Squeak3.8.1 of 16 July 2006 [latest update: #6744] on 13 December 2006
> at 12:19:34 pm'!
> ApplicationService subclass: #SSSessionExpirationService
>     instanceVariableNames: ''
>     classVariableNames: ''
>     poolDictionaries: ''
>     category: 'SentorsaSeaside-Services'!
> !SSSessionExpirationService commentStamp: '<historical>' prior: 0!
> SSSessionExpirationService initialize.!
> 
> 
> !SSSessionExpirationService methodsFor: 'running' stamp: 'rjl 12/4/2006
> 15:58'!
> runWhile: aBlock 
>     [aBlock value] whileTrue: 
>             [self informApplications.
>             self sleepFor: 10000]! !
> 
> 
> !SSSessionExpirationService methodsFor: 'private' stamp: 'rjl 12/11/2006
> 11:42'!
> informApplications
>     WADispatcher default entryPoints do: 
>             [:app | 
>             (app respondsTo: #unregisterExpiredHandlers) 
>                 ifTrue: [app unregisterExpiredHandlers]]! !
> 
> "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
> 
> SSSessionExpirationService class
>     instanceVariableNames: ''!
> 
> !SSSessionExpirationService class methodsFor: 'as yet unclassified' stamp:
> 'rjl 6/17/2006 13:22'!
> initialize
>     (ApplicationService servicesNamed: 'seaside session manager') ifEmpty: 
>             [self
>                 addService: (self newNamed: 'seaside session manager')
> start;
>                 yourself]! !
> 
> 
> SSSessionExpirationService initialize!
> 
> 
> Ramon Leon
> http://onsmalltalk.com  
> 
> 


More information about the Seaside mailing list