[Newbies] #Schedule - How to Use?
David Shaffer
cdshaffer at acm.org
Fri Jun 28 01:33:52 UTC 2019
I’ve been away from Squeak for a long time but I don’t think Schedule does what you want. I browsed the code a bit and it seems to be more about /storing/ a schedule rather than /executing/ one.
John Pierce wrote a package called Scheduler which I used with great success many (many) years ago. The SqueakMap entry still exists but the file links are dead. I have attached my latest version of that package. I tried it out in Squeak 5.2 and it seemed to work but I can’t make any promises. I don’t think it will have the same problems as a long Delay since its main loop seems to check for runnable tasks every 1/4 second.
The SqueakMap page has some docs: http://map.squeak.org/package/cb344d5b-c810-45cd-a440-534d900aacfd <http://map.squeak.org/package/cb344d5b-c810-45cd-a440-534d900aacfd>
BTW, to load the MCZ you can use the File List (under Tools).
Best,
David
> On Jun 24, 2019, at 5:16 PM, John-Reed Maffeo <jrmaffeo at gmail.com> wrote:
>
> 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
>
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190627/04abd3c5/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Scheduler-cds.21.mcz
Type: application/octet-stream
Size: 9897 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190627/04abd3c5/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/beginners/attachments/20190627/04abd3c5/attachment-0001.html>
More information about the Beginners
mailing list