Re: Looking for Design Suggestions
Re: Looking for Design Suggestions
- Subject: Re: Looking for Design Suggestions
- From: "S. J. Cunningham" <email@hidden>
- Date: Sun, 01 Nov 2015 11:34:52 -0500
On Nov 1, 2015, at 11:24 AM, Steve Bird wrote:
>
>> On Nov 1, 2015, at 8:37 AM, S. J. Cunningham <email@hidden> wrote:
>>
>> I have a script app which I want to run synchronously every two hours. However, I also want it to wake up on demand to respond to manual requests. One of those requests is for it to go into an Alarm State where it changes it's synchronous period from two hours to two minutes and then changes back to two hours once an All Clear signal has been received.
>>
>> I have been proceeding down the launchd, Stay-Open Agent path because of it's ability to both cycle synchronously and respond asynchronously to changes in a folder or to a "run" command from another app. However changing the cycle from two hours to two minutes is problematic. The only way I can see to do it is to unload the 2 hour plist and then reload a 2 minute plist and vice versa when I want to revert to two hours. However unloading causes the app and any it has spawned to quit. That is problematic.
>
> Consider having it run every two minutes, regardless, but keep your 2-hour count internally.
>
> i.e., every time you wake up, you count down. If you hit zero, do your work.
> If you’re in the “quick” state, set the count down to 1, so that you work on the next wake.
> If you’re in the “slow” state, set the count down to 60.
Yeah, that is my back-up plan and how it is implemented now, but I really would like to avoid the overhead of running it every two minutes 24/7 if I could :) Especially since the two minute Alarm cycle happens on the order of days or months.
Steve
------------------
OS X 10.6.8, AppleScript 2.1.2
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden