Announcements question

18 views
Skip to first unread message

Bernat Romagosa

unread,
May 7, 2012, 7:52:29 AM5/7/12
to il...@googlegroups.com
Hi list,

I've just read this in the Announcements chapter of the CollaborActive Book:

If your client object is to be destroyed before the subject, do not forget to unsubscribe it from the announcer, or it will not be garbage collected and will keep receiving events!
Parent>>delete
    self session announcer unsubscribe: self

Is that an issue I should be handling in Iliad? My sessions never expire, so I'm guessing this could end up in lots of instances of widgets who subscribed to an announcement.

If so, how can I know when a widget has just stopped being "used"?

Thanks!

--
Bernat Romagosa.

nicolas petton

unread,
May 8, 2012, 7:49:00 AM5/8/12
to il...@googlegroups.com


2012/5/7 Bernat Romagosa <tibabenfor...@gmail.com>
Hi list,


Hi Bernat, 
 
I've just read this in the Announcements chapter of the CollaborActive Book:

If your client object is to be destroyed before the subject, do not forget to unsubscribe it from the announcer, or it will not be garbage collected and will keep receiving events!
Parent>>delete
    self session announcer unsubscribe: self

Is that an issue I should be handling in Iliad? My sessions never expire

Why don't they expire?
 
, so I'm guessing this could end up in lots of instances of widgets who subscribed to an announcement.

If so, how can I know when a widget has just stopped being "used"?

You cannot know, because a tab with this widget could still be open. Until the session expires, all registered widgets/applications should be available.


Cheers,
Nico
 

Thanks!

--
Bernat Romagosa.

Bernat Romagosa

unread,
May 8, 2012, 11:43:17 AM5/8/12
to il...@googlegroups.com
Hi Nico,

They only expire if the user logs out. If a user comes back after a week, when he points at the app's url, he should still be logged in. Is there a better solution than to make sessions last forever? We went this way because we'll only have around 200 users, so we thought the session data wouldn't become that huge...

Cheers!

2012/5/8 nicolas petton <petton....@gmail.com>



--
Bernat Romagosa.

petton....@gmail.com

unread,
May 8, 2012, 1:58:44 PM5/8/12
to il...@googlegroups.com
Bernat Romagosa <tibabenfor...@gmail.com> writes:

> They only expire if the user logs out. If a user comes back after a
> week, when he points at the app's url, he should still be logged in.
> Is there a better solution than to make sessions last forever? We went
> this way because we'll only have around 200 users, so we thought the
> session data wouldn't become that huge...

I would clear the state of the session (actions and
applications/widgets) instead of doing a real expire, and set the expire
to 24 hrs.

This way you keep your users logged in, and keep your sessions
lightweight.

Cheers,
Nico

Bernat Romagosa

unread,
May 9, 2012, 5:07:09 AM5/9/12
to il...@googlegroups.com
Thanks Nico, we'll do as you advise :)




--
Bernat Romagosa.

Bernat Romagosa

unread,
May 9, 2012, 5:54:26 AM5/9/12
to il...@googlegroups.com
I'm trying to define the expiry seconds preference, but it doesn't seem to be working. I've tried the following:

MySession >> initialize
  super initialize.
  self expirySeconds: 10

and also:

MySession >> defaultExpirySeconds
  ^ 10

But I wait for 10 seconds and the #expire method isn't triggered. What am I doing wrong?

Thanks!

--
Bernat Romagosa.

Bernat Romagosa

unread,
May 9, 2012, 6:28:33 AM5/9/12
to il...@googlegroups.com
Figured it out!

The minimum expiry time is 10 minutes, as that's the interval at which ILSessionManager checks which sessions are expired. We were being too... impatient ;)

Everything working now, thanks!

2012/5/9 Bernat Romagosa <tibabenfor...@gmail.com>



--
Bernat Romagosa.

nicolas petton

unread,
May 9, 2012, 10:32:51 AM5/9/12
to il...@googlegroups.com
Cool!

Did you manage to clear the session state instead of really expiring it?

Something like the following should work:

MySession >> expire
    "Do not actually expire. Just clear the session state and keep users logged in."
    self 
        clearActionRegistry; 
        clearStateRegistries.
    applications := nil

Nico

2012/5/9 Bernat Romagosa <tibabenfor...@gmail.com>

Bernat Romagosa

unread,
May 9, 2012, 10:34:59 AM5/9/12
to il...@googlegroups.com
Yep, my expire is pretty similar :)

MySession >> expire
self actionRegistry unregisterAllActions.
applications := IdentityDictionary new.
announcer := Announcer new.
self
clearActionRegistry;
clearStateRegistries.

Thanks a lot!

Bernat.

2012/5/9 nicolas petton <petton....@gmail.com>



--
Bernat Romagosa.
Reply all
Reply to author
Forward
0 new messages