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
at:byexample [2008/08/11 20:34]
tvcutsem *
at:byexample [2009/10/08 14:11] (current)
tvcutsem
Line 11: Line 11:
  
 when: lightbulb<-toggleLight()@Due(seconds(10)) becomes: { |reply| 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 43: Line 44:
 </code> </code>
  
-Here, ''obj'' is either a far reference to the object (i.e. a remote object reference) if ''obj'' is pass-by-reference, or a copy of the object, if ''obj'' is pass-by-copy. To stop looking for a ''Type'' object in the ad hoc network, invoke ''sub.cancel()''.+Here, ''obj'' is either a far reference to the object (i.e. a remote object reference) if ''obj'' is pass-by-reference, or a copy of the object, if ''obj'' is pass-by-copy. ''sub'' refers to a subscription object. To stop looking for a ''Type'' object in the ad hoc network, invoke ''sub.cancel()''.
  
 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 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.1218479687.txt.gz · Last modified: 2008/08/12 15:15 (external edit)