[Glass] How to initialize a after startup of a system/gem ?

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

[Glass] How to initialize a after startup of a system/gem ?

marten
If a gem is started - how can I initialize a class variable to a
transient instance structure ?

Marten

--
Marten Feldtmann
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] How to initialize a after startup of a system/gem ?

James Foster-9
Marten,

See UserProfile>>#’loginHook:’ for code to run at login. See SessionTemps for transient structures.

A class variable would not be transient, but could contain an RcKeyValueDictionary where the key is the session number (System class>>#’session’) and the value is any object. The object would be persisted but would not conflict.

James


On Jan 10, 2014, at 7:10 AM, [hidden email] wrote:

> If a gem is started - how can I initialize a class variable to a
> transient instance structure ?
>
> Marten
>
> --
> Marten Feldtmann
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] How to initialize a after startup of a system/gem ?

Dale Henrichs-3
In reply to this post by marten
Marten,

If you are using GLASS, take a look at SystemLoginNotification. You can subscribe for a #sessionStart message to be sent to a global by subscribing with the name of a global:

  SystemLoginNotification subscribe: #MCWorkingCopy

The #sessionStart message is then sent shortly after login.

Also for dealing with session temps, I tend to favor lazy initialization when possible.  SessionTemps current is empty everytime the session is started, so it is a pretty reliable indicator...


Dale


----- Original Message -----
| From: [hidden email]
| To: [hidden email]
| Sent: Friday, January 10, 2014 7:10:52 AM
| Subject: [Glass] How to initialize a after startup of a system/gem ?
|
| If a gem is started - how can I initialize a class variable to a
| transient instance structure ?
|
| Marten
|
| --
| Marten Feldtmann
| _______________________________________________
| Glass mailing list
| [hidden email]
| http://lists.gemtalksystems.com/mailman/listinfo/glass
|
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass