[Seaside] How to get the number of user connected
Ramon Leon
ramon.leon at allresnet.com
Wed Dec 13 19:24:32 UTC 2006
> 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