[Fwd: Re: Iliad: sessions and streaming]

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Fwd: Re: Iliad: sessions and streaming]

Nicolas Petton


Le lundi 22 juin 2009 à 17:50 +0200, Joachim Jaeckel a écrit :

> Hi Nico,
>
> > You should probably subclass Iliad.Session, then use it in the
> > SessionManager: Iliad.SessionManager sessionClass: MySession
>
> *mmmmhhh* I would need an additional bit of help...
>
> I tried it with:
> Iliad.SessionManager current sessionClass: UrPicsSession.
> Iliad.SessionManager current newSession.
>
> in my Application>>initialize method.
>
> I got no errors, but if I try afterwards a
> self session userLoggedIn: false.
> (I have a new variable and the needed accessors)
>
> it fails, with the message that Iliad.Session does not understand
> userLoggedIn:
>
> Maybe I have to connect the new created session to the application?
The problem you have is because, while new sessions will be instances of
your class, it seems that you already had a session.

You can force Iliad to remove all current sessions (these are instances
of Iliad.Session, because those sessions were created before you changed
the #sessionClass) with:

Iliad.SessionManager current removeAllSessions

Then a new session, instance of UrPicsSession, will be created.

HTH,

Nico

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

signature.asc (204 bytes) Download Attachment
signature.asc (204 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Fwd: Re: Iliad: sessions and streaming]

Joachim Jaeckel
Sorry Nicolas...

> The problem you have is because, while new sessions will be instances of
> your class, it seems that you already had a session.
>
> You can force Iliad to remove all current sessions (these are instances
> of Iliad.Session, because those sessions were created before you changed
> the #sessionClass) with:
>
> Iliad.SessionManager current removeAllSessions
>
> Then a new session, instance of UrPicsSession, will be created.

I tried it now with:

Iliad.SessionManager current sessionClass: UrPicsSession.
Iliad.SessionManager current removeAllSessions.
Iliad.SessionManager current newSession.

And even that doesn't work. Do I have to set the sessionClass maybe in
the "Workspace" where I start Swazoo?

(Or is there an example where I can have a look?)

> HTH,

Sorry, currently not... :-/

Joachim.


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [Fwd: Re: Iliad: sessions and streaming]

Nicolas Petton
The following works for me:

st> PackageLoader fileInPackage: 'Iliad'
st> FileStream fileIn: 'SessionSubclassExample.st'
st> Iliad.SwazooIliad startOn: 7777
st> Iliad.SessionManager current sessionClass: MySession
st> Iliad.SessionManager current removeAllSessions "Only needed if there
are existing sessions, instances of the old #sessionClass value"
st> Processor activeProcess suspend

http://localhost:7777/session_test

The SessionSubclassExample.st file is attached.

Cheers!

Nico

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

SessionSubclassExample.st (582 bytes) Download Attachment
signature.asc (204 bytes) Download Attachment