Image-specific "cache"

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

Image-specific "cache"

Uko2
Hi,

I want to persist some value (in a singleton), but when a user creates a copy of the image, it want to regenerate that data, so the will be no who images with the same persisted data. Is there some way to act on image launch? Or maybe you have more suggestions…

Cheers,
Uko
Reply | Threaded
Open this post in threaded view
|

Re: Image-specific "cache"

Uko2
Sorry, my last email is UNREADABLE!

Here is the spellchecked version:

Hi,

I want to persist some value (in a singleton), but when a user creates a copy of the image, I want to regenerate that data, so there will be no two images with the same persisted data. Is there some way to act on an image launch? Or maybe you have better suggestions…

Cheers,
Uko


On 03 Sep 2015, at 12:25, Yuriy Tymchuk <[hidden email]> wrote:

Hi,

I want to persist some value (in a singleton), but when a user creates a copy of the image, it want to regenerate that data, so the will be no who images with the same persisted data. Is there some way to act on image launch? Or maybe you have more suggestions…

Cheers,
Uko

Reply | Threaded
Open this post in threaded view
|

Re: Image-specific "cache"

ccrraaiigg

Hoi Uko--

> I want to persist some value (in a singleton), but when a user
> creates a copy of the image, I want to regenerate that data, so there
> will be no two images with the same persisted data. Is there some way
> to act on an image launch?

     Sure, you can tie into the StartUpList and ShutDownList in
SmalltalkImage. This is how the delay scheduler is restarted on system
startup, for example.

> Or maybe you have better suggestions...

     This seems like the conventional way of doing things like that, as
long the system doesn't need the assistance of another running system to
compute the data.


     cheers,

-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

Re: Image-specific "cache"

Stephan Eggermont-3
In reply to this post by Uko2
On 03-09-15 12:33, Yuriy Tymchuk wrote:
> I want to persist some value (in a singleton), but when a user creates a copy of the image, I want to regenerate that data, so there will be no two images with the same persisted data. Is there some way to act on an image launch? Or maybe you have better suggestions…

You could use

SHA1 hashMessage: FileSystem workingDirectory fullName

to see if you are in the same image, and you could
add a class to the startuplist like GTPlayBook does

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: Image-specific "cache"

Max Leske
In reply to this post by Uko2
You could also use the session checking logic NativeBoost uses. Take a look at NativeBoost>>sessionChanged et al.

Cheers,
Max

On 03 Sep 2015, at 12:33, Yuriy Tymchuk <[hidden email]> wrote:

Sorry, my last email is UNREADABLE!

Here is the spellchecked version:

Hi,

I want to persist some value (in a singleton), but when a user creates a copy of the image, I want to regenerate that data, so there will be no two images with the same persisted data. Is there some way to act on an image launch? Or maybe you have better suggestions…

Cheers,
Uko


On 03 Sep 2015, at 12:25, Yuriy Tymchuk <[hidden email]> wrote:

Hi,

I want to persist some value (in a singleton), but when a user creates a copy of the image, it want to regenerate that data, so the will be no who images with the same persisted data. Is there some way to act on image launch? Or maybe you have more suggestions…

Cheers,
Uko


Reply | Threaded
Open this post in threaded view
|

Re: Image-specific "cache"

tinchodias
There is also SnapshotDone, announced in SystemAnnouncer.

Martin

On Thu, Sep 3, 2015 at 1:32 PM, Max Leske <[hidden email]> wrote:
You could also use the session checking logic NativeBoost uses. Take a look at NativeBoost>>sessionChanged et al.

Cheers,
Max

On 03 Sep 2015, at 12:33, Yuriy Tymchuk <[hidden email]> wrote:

Sorry, my last email is UNREADABLE!

Here is the spellchecked version:

Hi,

I want to persist some value (in a singleton), but when a user creates a copy of the image, I want to regenerate that data, so there will be no two images with the same persisted data. Is there some way to act on an image launch? Or maybe you have better suggestions…

Cheers,
Uko


On 03 Sep 2015, at 12:25, Yuriy Tymchuk <[hidden email]> wrote:

Hi,

I want to persist some value (in a singleton), but when a user creates a copy of the image, it want to regenerate that data, so the will be no who images with the same persisted data. Is there some way to act on image launch? Or maybe you have more suggestions…

Cheers,
Uko