Re: How to create a background process
Might want to check anacron and fcron also - if you are not sure of having the machine turned on at the exact time the background app tries to run, and don't want to miss a cycle because of that. fcron is a better anacron. I have used fcron with Sarah's emailer to send a backup email with attachment of the file in question. http://en.wikipedia.org/wiki/Anacron Richard Gaskin wrote: ...On Mac and Linux, man cron On Windows, this tutorial on the Task Scheduler includes a batch script: http://www.iopus.com/guides/winscheduler.htm -- View this message in context: http://www.nabble.com/How-to-create-a-background-process-tp25616331p25631396.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
Josep wrote: Hi, I experimented with the send in time command. I need to program some tasks to run at fixed time and days. Like schedule a task for a backup for example. How can control this? Any experience? And how lunch these task in the way that don't stop or delay the app and/or system? My idea is to program the time that the task must be run. When the app is lunched I check thr task for day and send in time the task. The task will be executed by a standalone stack. The task are backups and calculate grand totals. By other way a lunch speak messages to the user, but if one message is runnig and one second message start, the first is stoped. How wait until the revspeak finish before start the next? I tryed from a custom message and using wait for message but doesn't work. Thoughts? Salut, Josep A heads-up, just in case it happens to you, too. I've had difficulties with the Send in time process. As long as the Rev task is the only Vista task running, it works fine. ie: it can run all weekend, firing itself every nn minutes (15 or less depending on context). However, during the week when I am using my PC to do other things at the same time (multiple browser sessions, for instance), the message I sent in time doesn't always get triggered. I have to manually restart it. I don't know what causes that to happen. I have spent an hour or two trying to track it down, but since the task is not critical to my daily operations, I just ignore the problem and restart it manually. It's frustrating, because I occasionally miss an interesting event that I'm tracking, but it's not worth the time and effort to spend a bunch of time tracking it down. The driver task just does a put URL tURL into tMessageHTML and then re-triggers itself with a send autoCapture to me in tSeconds seconds before it processes the tMessageHTML it received. The task has only one stack; the mainstack. I think that means the autoCapture message isn't getting fired in tSeconds seconds, or it's getting fired and for some reason doesn't get processed. TED -- View this message in context: http://www.nabble.com/How-to-create-a-background-process-tp25616331p25636469.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
Thanks for the info, I still testing. When finish I explain my experiencie. Salut, Josep TEDennis wrote: Josep wrote: Hi, I experimented with the send in time command. I need to program some tasks to run at fixed time and days. Like schedule a task for a backup for example. How can control this? Any experience? And how lunch these task in the way that don't stop or delay the app and/or system? My idea is to program the time that the task must be run. When the app is lunched I check thr task for day and send in time the task. The task will be executed by a standalone stack. The task are backups and calculate grand totals. By other way a lunch speak messages to the user, but if one message is runnig and one second message start, the first is stoped. How wait until the revspeak finish before start the next? I tryed from a custom message and using wait for message but doesn't work. Thoughts? Salut, Josep A heads-up, just in case it happens to you, too. I've had difficulties with the Send in time process. As long as the Rev task is the only Vista task running, it works fine. ie: it can run all weekend, firing itself every nn minutes (15 or less depending on context). However, during the week when I am using my PC to do other things at the same time (multiple browser sessions, for instance), the message I sent in time doesn't always get triggered. I have to manually restart it. I don't know what causes that to happen. I have spent an hour or two trying to track it down, but since the task is not critical to my daily operations, I just ignore the problem and restart it manually. It's frustrating, because I occasionally miss an interesting event that I'm tracking, but it's not worth the time and effort to spend a bunch of time tracking it down. The driver task just does a put URL tURL into tMessageHTML and then re-triggers itself with a ||send autoCapture to me in tSeconds seconds|| before it processes the tMessageHTML it received. The task has only one stack; the mainstack. I think that means the autoCapture message isn't getting fired in tSeconds seconds, or it's getting fired and for some reason doesn't get processed. TED -- View this message in context: http://www.nabble.com/How-to-create-a-background-process-tp25616331p25638635.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
Hi, I experimented with the send in time command. I need to program some tasks to run at fixed time and days. Like schedule a task for a backup for example. How can control this? Any experience? And how lunch these task in the way that don't stop or delay the app and/or system? My idea is to program the time that the task must be run. When the app is lunched I check thr task for day and send in time the task. The task will be executed by a standalone stack. The task are backups and calculate grand totals. By other way a lunch speak messages to the user, but if one message is runnig and one second message start, the first is stoped. How wait until the revspeak finish before start the next? I tryed from a custom message and using wait for message but doesn't work. Thoughts? Salut, Josep -- View this message in context: http://www.nabble.com/How-to-create-a-background-process-tp25616331p25629413.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
Josep said: By other way a lunch speak messages to the user, but if one message is runnig and one second message start, the first is stoped. How wait until the revspeak finish before start the next? for this part check out wait until the sound is done ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
Josep wrote: I experimented with the send in time command. I need to program some tasks to run at fixed time and days. Like schedule a task for a backup for example. How can control this? Any experience? And how lunch these task in the way that don't stop or delay the app and/or system? My idea is to program the time that the task must be run. When the app is lunched I check thr task for day and send in time the task. The task will be executed by a standalone stack. The task are backups and calculate grand totals. By other way a lunch speak messages to the user, but if one message is runnig and one second message start, the first is stoped. How wait until the revspeak finish before start the next? I tryed from a custom message and using wait for message but doesn't work. Thoughts? On Mac and Linux, man cron On Windows, this tutorial on the Task Scheduler includes a batch script: http://www.iopus.com/guides/winscheduler.htm HTH - -- Richard Gaskin Fourth World Revolution training and consulting: http://www.fourthworld.com Webzine for Rev developers: http://www.revjournal.com revJournal blog: http://revjournal.com/blog.irv ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
RE: How to create a background process
Josep wrote: Hi, I experimented with the send in time command. I need to program some tasks to run at fixed time and days. Like schedule a task for a backup for example. How can control this? Any experience? And how lunch these task in the way that don't stop or delay the app and/or system? My idea is to program the time that the task must be run. When the app is lunched I check thr task for day and send in time the task. The task will be executed by a standalone stack. The task are backups and calculate grand totals. By other way a lunch speak messages to the user, but if one message is runnig and one second message start, the first is stoped. How wait until the revspeak finish before start the next? I tryed from a custom message and using wait for message but doesn't work. When I've done this, I write one handler that when an app is launched reads in the tasks to be performed from a db (it could read them in from a file). If any tasks are over-due, it performs them either immediately or recalculates a new time for the task (as in a backup that should only be performed at night) and saves it off to disk as well as a custom property, so it doesn't have to keep checking the disk. It then sorts by time and if the next task is to be performed in say 6 hours, it sends to itself in 5 hours and 59 minutes. ;-) When it is called, it first checks the custom property and if there are tasks, it uses the next one at the appropriate time and if it is empty, it means the app has just been launched, so it then reads from disk as above. Once it performs a task, it calculates the next time, saves it off to disk and the custom property. It then looks at the next closest task to now and if that is say 24 hours away, it sends to itself in 23 hrs and 59 minutes... In this fashion, no task is ever missed and the handler only runs when it has to and it only has to check the disk once on launch, although it writes to disk whenever it performs a task. If you are only running on Windows, you can use the Registry for saving off pending tasks. All this assumes that your app is usually running. You can do this by installing your app to always load and run invisibly on system boot or use Richard's suggestion of having a system task scheduler launch the app. There is one other element you need. Assuming you have a preferences screen and the user can change the time of a scheduled task, you need that screen to write the change both to disk/registry and the custom property. You then need a setProp handler that when the customProperty changes, wakes up the background task handler, so it can recalculate when its next task is. If it is earlier than previously calculated, it deletes its previous message from the pendingMessages and does a new send to itself. To cancel a pending message you can use: IF myHandlerName is in the pendingmessages THEN get lineoffset(myHandlerName,pendingmessages()) cancel item 1 of line it of the pendingmessages END IF Then just do a new send in time. Lastly, when you have a setProp/getProp, always remember to turn off messages before the background task handler writes to the custom property or you will find yourself in an infinite loop. You turn messages back on after the write. Aloha from Hawaii, Jim Bufalini ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
stephen barncard wrote: Josep said: By other way a lunch speak messages to the user, but if one message is runnig and one second message start, the first is stoped. How wait until the revspeak finish before start the next? for this part check out wait until the sound is done Or since you are using revSpeak: wait until revIsSpeaking() = false -- Phil Davis PDS Labs Professional Software Development http://pdslabs.net ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
Josep Try this crude example, and add your own timing and functionality. In the card script: on preopenStack send yourMessage to this cd end preopenStack on yourMessage var if var = 5 then close this stack -- some condition to exit put random(9) into var put var --just to see it send yourMessage var to this card in 2 seconds -- your timing here end yourMessage Craig Newman In a message dated 9/25/09 1:51:46 PM, jmye...@mac.com writes: The process need every x time check or perform some action. But each time that the process run the x var will be randomized and execute the process depending the last x value. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: How to create a background process
Thanks, I will try to test my process. Salut, Josep dunbarx wrote: Josep Try this crude example, and add your own timing and functionality. In the card script: on preopenStack send yourMessage to this cd end preopenStack on yourMessage var if var = 5 then close this stack -- some condition to exit put random(9) into var put var --just to see it send yourMessage var to this card in 2 seconds -- your timing here end yourMessage Craig Newman In a message dated 9/25/09 1:51:46 PM, jmye...@mac.com writes: The process need every x time check or perform some action. But each time that the process run the x var will be randomized and execute the process depending the last x value. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- View this message in context: http://www.nabble.com/How-to-create-a-background-process-tp25616331p25621008.html Sent from the Revolution - User mailing list archive at Nabble.com. ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution