dictionary:more:dolater
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
dictionary:more:dolater [2017/06/02 21:03] – external edit 127.0.0.1 | dictionary:more:dolater [2018/01/15 15:23] – [Do Later] added more info and link to motion controlled light James Sentman | ||
---|---|---|---|
Line 2: | Line 2: | ||
Execute a handler in the same script in some number of milliseconds. It’s often necessary to add in a “delay” to some scripts when talking to other devices or programs, unfortunately a delay causes the entire program to block until the delay is complete. This is not acceptable for an application that must remain responsive to other input while that script is running. **do later** lets you schedule handlers in a script to happen one after another as if the script was written entirely inline but with delay statements while avoiding the problems of blocking the entire app for extended periods of time. | Execute a handler in the same script in some number of milliseconds. It’s often necessary to add in a “delay” to some scripts when talking to other devices or programs, unfortunately a delay causes the entire program to block until the delay is complete. This is not acceptable for an application that must remain responsive to other input while that script is running. **do later** lets you schedule handlers in a script to happen one after another as if the script was written entirely inline but with delay statements while avoiding the problems of blocking the entire app for extended periods of time. | ||
+ | Do Later is similar to just using the [[dictionary: | ||
+ | |||
+ | There is no interface currently to the outstanding do later events you’ve created in a script. In order to stop a runaway do later cascade is to edit the script and just put a “return” at the front of the handler you’re calling back into so that it stops before the next do later is created. | ||
+ | |||
+ | Don’t use do later for things that you need to adjust the timing of, or things where you might create more and more of them like a motion controlled light. Use the [[tutorials: | ||
===Usage: | ===Usage: | ||
**do later** [text] the name of the handler to do later. This will always be in the same script, you cannot do later into a different script. This works for Global Script, unit ON or OFF scripts or Interface scripts.\\ | **do later** [text] the name of the handler to do later. This will always be in the same script, you cannot do later into a different script. This works for Global Script, unit ON or OFF scripts or Interface scripts.\\ | ||
Line 26: | Line 31: | ||
===Notes: | ===Notes: | ||
* Added to XTension in version 9.3 on 6/2/2017 | * Added to XTension in version 9.3 on 6/2/2017 | ||
- | * Only one “do later” delay can be running in a specific | + | * As of version 9.3.8 as many do later timers |
+ | * There was a bug in the implementation of the with data information in version 9.3.8 that might have caused the wrong data to have been passed to the callback handler. This was fixed in 9.3.9. |
dictionary/more/dolater.txt · Last modified: 2023/02/13 14:52 by 127.0.0.1