at:byexample
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
at:byexample [2008/08/11 20:32] – * tvcutsem | at:byexample [2009/10/08 14:11] (current) – tvcutsem | ||
---|---|---|---|
Line 10: | Line 10: | ||
import / | import / | ||
- | when: lightbulb< | + | when: lightbulb< |
- | // code to execute when the light bulb switched on | + | // code to execute when the message has been |
- | // lightStatus | + | // succesfully processed. |
+ | // reply refers to the return value of the | ||
// toggleLight method. | // toggleLight method. | ||
} catch: TimeoutException using: { |e| | } catch: TimeoutException using: { |e| | ||
Line 43: | Line 44: | ||
</ | </ | ||
- | Here, '' | + | Here, '' |
The above block is triggered upon discovering one object of the appropriate (sub)type. If one wants to trigger a block every time an object of the appropriate type is discovered, execute: | The above block is triggered upon discovering one object of the appropriate (sub)type. If one wants to trigger a block every time an object of the appropriate type is discovered, execute: | ||
Line 100: | Line 101: | ||
def sub := when: seconds(10) elapsed: { | def sub := when: seconds(10) elapsed: { | ||
- | | + | |
} | } | ||
</ | </ | ||
Line 108: | Line 109: | ||
<code javascript> | <code javascript> | ||
whenever: minutes(1) elapsed: { | whenever: minutes(1) elapsed: { | ||
- | // code to execute | + | // code to execute |
} | } | ||
</ | </ |
at/byexample.1218479549.txt.gz · Last modified: 2008/08/11 20:33 (external edit)