Squeak 'cron'-like functionality?

Nick Brown maillist at bredon-gill.demon.co.uk
Wed Oct 3 01:31:27 UTC 2001


By chance, I was investigating this just yesterday. I ended up
using....

World addAlarm: #myMethod
	 withArguments: #()
	 for: self
	 at: (Time millisecondClockValue + 2000)

...to allow my class to call #myMethod after 2 seconds. 

I used this as it seems to be the only type of alarm creation method
which allows you to specify the target for the alarm. Also, it only
deals in absolute time - most of the other alarm methods have an
alternative along the lines of  #addAlarm:with:after:  

You can see from my code above that I've made do without by
collecting the current time and adding to it.

Would it be worth adding   #addAlarm:withArguments:for:after:  to
PasteUpMorph ?

Regards,
Nick


On Tue, 2 Oct 2001 19:02:51 -0400, Kevin Fisher wrote:

>Thanks for the pointer!  I'll take a look at Alarm and see if it works
>for me...
>
>On Tue, Oct 02, 2001 at 06:24:28PM -0400, Rob Withers wrote:
>[snip]
>> 
>> If you have a World, there is protocol for scheduling an Alarm....    Use 
>> the message finder for schedule...
>> 
>> For truly headless apps, I wish this were a function of the 
>> ProcessScheduler, and I am actually modifying my DispatchQueue framework to 
>> allow for scheduled alarms, for this very reason, but it does overlap a lot 
>> with the foreground Morphic Alarms.
>> 
>> Rob
>> 
>> 
>






More information about the Squeak-dev mailing list