[Newbies] #Schedule - How to Use?

John-Reed Maffeo jrmaffeo at gmail.com
Mon Jun 24 21:16:47 UTC 2019


I am working on an application which requires task scheduler like cron on
UNIX or Task Manager on Windows. In the swiki , there is a page about
Refactored
Date and Time Classes <http://wiki.squeak.org/squeak/1871> which mentions
#Schedule in the context of TV programs. I have figured out how to set up,
but I can not figure out how to use it productively.

My simple use case is:
a. create an instance of #Schedule
b. Use the schedule to write a string to the Transcript based on the
contents of the schedule.


|sampleSchedule  rightNow cr |

rightNow := DateAndTime now.
cr := String cr.

sampleSchedule := Schedule starting: rightNow  ending: rightNow + 20
minutes .

sampleSchedule schedule: {Duration minutes: 1. Duration minutes: 3}.
sampleSchedule  scheduleDo:[:each |Transcript show: each asString, String
cr].
>> This results in all of the schedule items being written to the
Transcript immediately, rather at the schedule time for each.

How to I use a schedule to run a block at the time specified by the
schedule.

I have looked at #Delay, but it has a limit of ~six days which will not
work for me.

Thanks,

-jrm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190624/86e72008/attachment.html>


More information about the Beginners mailing list