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
Next revision Both sides next revision
at:byexample [2008/08/11 20:32]
tvcutsem *
at:byexample [2008/08/11 20:34]
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 light bulb switched on
   // lightStatus refers to the return value of the   // lightStatus refers to the return value of the
Line 100: Line 100:
  
 def sub := when: seconds(10) elapsed: { def sub := when: seconds(10) elapsed: {
-  ...+  // code to execute after 10 seconds
 } }
 </code> </code>
at/byexample.txt ยท Last modified: 2009/10/08 14:11 by tvcutsem