User Tools

Site Tools


at:byexample

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
at:byexample [2008/08/11 20:32]
tvcutsem *
at:byexample [2008/08/12 15:16]
tvcutsem *
Line 10: Line 10:
 import /.at.lang.futures; import /.at.lang.futures;
  
-when: lightbulb<-toggleLight()@Due(seconds(10)) becomes: { |lightStatus+when: lightbulb<-toggleLight()@Due(seconds(10)) becomes: { |reply
-  // code to execute when the light bulb switched on +  // code to execute when the message has been 
-  // lightStatus refers to the return value of the+  // succesfully processed. 
 +  // reply refers to the return value of the
   // toggleLight method.   // toggleLight method.
 } catch: TimeoutException using: { |e| } catch: TimeoutException using: { |e|
Line 100: Line 101:
  
 def sub := when: seconds(10) elapsed: { def sub := when: seconds(10) elapsed: {
-  ...+  // code to execute after 10 seconds
 } }
 </code> </code>
Line 108: Line 109:
 <code javascript> <code javascript>
 whenever: minutes(1) elapsed: { whenever: minutes(1) elapsed: {
-  // code to execute after 1 minute+  // code to execute every minute
 } }
 </code> </code>
at/byexample.txt · Last modified: 2009/10/08 14:11 by tvcutsem