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
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@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Of course as soon as I hit send it occurred to me that someone else has probably get Scheduler up to date. I found it on SqueakSource:
http://www.squeaksource.com/@11SzkA9kWVz1KQiQ/c5tTlndq http://www.squeaksource.com/@11SzkA9kWVz1KQiQ/c5tTlndq
And a version on Smalltalk hub:
http://smalltalkhub.com/#!/~TorstenBergmann/Scheduler http://smalltalkhub.com/#!/~TorstenBergmann/Scheduler
Either of those might be better than the one I sent you (which was quite old).
Best,
David
On Jun 27, 2019, at 9:33 PM, David Shaffer cdshaffer@acm.org wrote:
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
<Scheduler-cds.21.mcz>
On Jun 24, 2019, at 5:16 PM, John-Reed Maffeo <jrmaffeo@gmail.com mailto:jrmaffeo@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@lists.squeakfoundation.org mailto:Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
David,
Thank you! Your observation about #Schedule, it seems to be correct. I have been trying things out since I sent my original question and came to the same conclusion, it just builds a collection of #DateAndTime objects which may be useful in conjunction with #Delay.
Some tests with #Delay in a current 64 bit image produce results which produce results which exceed the limit of ~six days which I mentioned in my original post. I got the limit from the Delay http://wiki.squeak.org/squeak/3134 entry on the Squeak Wiki.
So I have two options to investigate now #Delay and #Scheduler.
Thanks for looking up Torsten's version. I had seen a mention of it, but I was trying to stay within the bounds of a standard release. I will take a look.
Regards,
-jrm
P.S. For someone who has been away from Squeak for a long time, you still have very good advice to share :-)
On Thu, Jun 27, 2019 at 6:34 PM David Shaffer cdshaffer@acm.org wrote:
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
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@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
On Thu, Jun 27, 2019 at 07:00:08PM -0700, John-Reed Maffeo wrote:
David,
Thank you! Your observation about #Schedule, it seems to be correct. I have been trying things out since I sent my original question and came to the same conclusion, it just builds a collection of #DateAndTime objects which may be useful in conjunction with #Delay.
Some tests with #Delay in a current 64 bit image produce results which produce results which exceed the limit of ~six days which I mentioned in my original post. I got the limit from the Delay http://wiki.squeak.org/squeak/3134 entry on the Squeak Wiki.
It is quite possible that the six day limit goes away on a 64 bit image (I did not check) because SmallInteger is not small any more :-)
As a side note, you can delay for 365 days like this:
d := 1 day asDelay. 365 timesRepeat: [ d wait ].
But relying on long delays to execute a schedule does not sound like a very good idea anyway, so the Scheduler package by John Pierce sounds like a good tip.
If you are concerned with tracking daylight savings time changes in your schedules, the TZ-Olson package on SqueakMap may be useful (latest Squeak trunk only).
Dave
So I have two options to investigate now #Delay and #Scheduler.
Thanks for looking up Torsten's version. I had seen a mention of it, but I was trying to stay within the bounds of a standard release. I will take a look.
Regards,
-jrm
P.S. For someone who has been away from Squeak for a long time, you still have very good advice to share :-)
On Thu, Jun 27, 2019 at 6:34 PM David Shaffer cdshaffer@acm.org wrote:
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
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@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
DavidTL,
Thanks for your feedback! 64 bit #Delay does have a much broader range than what is indicated on the Wiki. Your suggestion about using #Scheduler sounds good and there must be a compelling reason to use it over #Delay; why else go to the effort to create a new class? I have it installed in my image now and learning how to use it.
-jrm
On Thu, Jun 27, 2019 at 7:36 PM David T. Lewis lewis@mail.msen.com wrote:
On Thu, Jun 27, 2019 at 07:00:08PM -0700, John-Reed Maffeo wrote:
David,
Thank you! Your observation about #Schedule, it seems to be correct. I
have
been trying things out since I sent my original question and came to the same conclusion, it just builds a collection of #DateAndTime objects
which
may be useful in conjunction with #Delay.
Some tests with #Delay in a current 64 bit image produce results which produce results which exceed the limit of ~six days which I mentioned in
my
original post. I got the limit from the Delay http://wiki.squeak.org/squeak/3134 entry on the Squeak Wiki.
It is quite possible that the six day limit goes away on a 64 bit image (I did not check) because SmallInteger is not small any more :-)
As a side note, you can delay for 365 days like this:
d := 1 day asDelay. 365 timesRepeat: [ d wait ].
But relying on long delays to execute a schedule does not sound like a very good idea anyway, so the Scheduler package by John Pierce sounds like a good tip.
If you are concerned with tracking daylight savings time changes in your schedules, the TZ-Olson package on SqueakMap may be useful (latest Squeak trunk only).
Dave
So I have two options to investigate now #Delay and #Scheduler.
Thanks for looking up Torsten's version. I had seen a mention of it, but
I
was trying to stay within the bounds of a standard release. I will take a look.
Regards,
-jrm
P.S. For someone who has been away from Squeak for a long time, you still have very good advice to share :-)
On Thu, Jun 27, 2019 at 6:34 PM David Shaffer cdshaffer@acm.org wrote:
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
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@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@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
beginners@lists.squeakfoundation.org