How to safely run code on Image startup?

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

How to safely run code on Image startup?

maddyfreccero
I want to create an auto build facility in Dolphin - and the first step
is safely running/loading some code on image startup.

I looked at using the file prestart.st - however that prompts me if I
want to file in the code - so my automated process wont work.

Next I looked at doing:

SessionManager current when: #sessionStarted send: #onStartup to: self

and in my onStartup I do:

onStartup
        [Transcript
                cr;
                display: 'SmallCruise startup: ' , SessionManager current argv
printString;
                cr]
                        forkAt: Processor userBackgroundPriority


However that hangs my image with 100% cpu usage until I ctrl-break (I
add the forkAt: to see if I could get it to happen later).

Is there some trick to do this as late as possible in the system? I
assume its the Transcript writing that gives me some issues - however
if I want to load packages in my startup and run tests, then that will
probably cause writes to the transcript that will give me the same
issue.

Anywone got any tips?

Tim


Reply | Threaded
Open this post in threaded view
|

Re: How to safely run code on Image startup?

Tim M
Actually - loaded up DSDN and found all the info I needed - thanks to
Bill Dargel for posting what he did in 2005.

Tim


Reply | Threaded
Open this post in threaded view
|

Re: How to safely run code on Image startup?

Bill Dargel
TimM wrote:
> Actually - loaded up DSDN and found all the info I needed - thanks to
> Bill Dargel for posting what he did in 2005.

You're welcome! :-)

Actually, what I posted was back on 3 April 2003. Though it does seem to
come back to haunt me ;-) every few years.

http://groups.google.com/group/comp.lang.smalltalk.dolphin/browse_thread/thread/858f200e9023f6c2?hl=en#fb02f609c946d162

Perhaps Object Arts could be persuaded to include something similar in
the base image as the "official" way to have a command line argument
fire off a Smalltalk fileIn?

--
Bill Dargel            [hidden email]
Shoshana Technologies
100 West Joy Road, Ann Arbor, MI 48105  USA