dictionary:more:dolater
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
dictionary:more:dolater [2018/01/12 18:59] – [Notes:] James Sentman | dictionary:more:dolater [2018/01/15 15:28] – James Sentman | ||
---|---|---|---|
Line 1: | Line 1: | ||
====Do Later==== | ====Do Later==== | ||
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: | ||
+ | |||
+ | If you need a regular callback to the same handler or need to create such an event in another script use the [[dictionary: | ||
+ | |||
+ | A Global Script named “[[xtension_manual: | ||
===Usage: | ===Usage: | ||
Line 23: | Line 33: | ||
end partThree | end partThree | ||
</ | </ | ||
+ | |||
+ | ===See Also:=== | ||
+ | * [[dictionary: | ||
+ | * [[dictionary: | ||
+ | * [[xtension_manual: | ||
===Notes: | ===Notes: |
dictionary/more/dolater.txt · Last modified: 2023/02/13 14:52 by 127.0.0.1