User Tools

Site Tools


at:tutorial:distribution

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
at:tutorial:distribution [2009/01/29 10:27] elisagat:tutorial:distribution [2009/01/29 10:33] elisag
Line 134: Line 134:
 </code> </code>
  
-The ''lease:for:'' construct takes as parameters a time interval (in milliseconds) and the remote object to which it grants access, and returns a leased far reference that remains valid for the indicated time interval (5 minutes in the example). The construct alters the parameter passing semantics of the remote object to which it grants access, which gets parameter passed by lease rather than the default by far reference semantics. +The ''lease:for:'' construct takes as parameters a time interval (in milliseconds) and the remote object to which it grants access, and returns a leased reference that remains valid for the indicated time interval (5 minutes in the example). The construct alters the parameter passing semantics of the remote object to which it grants access, which gets parameter passed by lease rather than the default by far reference semantics. 
  
 <note> <note>
Line 202: Line 202:
 Single-call leases are useful for objects adhering to a single call pattern, such as callback objects. Callback objects are often used in asynchronous message passing schemes in order for remote object to be able to return values. These callback objects are typically remotely accessed only once by remote objects with the computed return value. In AmbientTalk, futures serves as an implicit callback. Single-call leases are useful for objects adhering to a single call pattern, such as callback objects. Callback objects are often used in asynchronous message passing schemes in order for remote object to be able to return values. These callback objects are typically remotely accessed only once by remote objects with the computed return value. In AmbientTalk, futures serves as an implicit callback.
  
-We have integrated leasing into futures by parameter-passing a future attached to an asynchronous message via a singe-call lease which either expires due to a timeout or upon the reception of the computed return value. The timeout for the implicit single-call lease on a future can be set by annotating the asynchronous message with a @Due annotation as follows:+We have integrated leasing into futures by parameter-passing a future attached to an asynchronous message via a singe-call lease which either expires due to a timeout or upon the reception of the computed return value. The timeout for the implicit single-call lease on a future can be set by annotating the asynchronous message with a ''@Due'' annotation as follows:
  
 <code> <code>
Line 213: Line 213:
 </code> </code>
  
-If the future is resolved, the session variable stores a leased object reference to the remote session object.  A TimeoutException is raised when the future’s lease expires, i.e. when the reception of the computed return value is not received before the lease time elapsed.+If the future is resolved, the session variable stores a leased object reference to the remote session object. ''TimeoutException'' is raised when the future’s lease expires, i.e. when the reception of the computed return value is not received before the lease time elapsed.
  
 <note> <note>
-Note that specifying a catch: block for the TimeoutException is equivalent to installing a when:expired: observer on the future’s (server-side) lease. +Note that specifying a ''catch:'' block for the ''TimeoutException'' is equivalent to installing a ''when:expired:'' observer on the future’s (server-side) lease. 
 </note> </note>
  
 ====Importing leased object references==== ====Importing leased object references====
  
-Similar to futures, leased object references have been built reflectively on top of AmbientTalk.  The system library shipped with AmbientTalk contains the reflective implemention that adds leased references to the language kernel. This implementation can be found in the file at/lang/leasedrefs.at. +Similar to futures, leased object references have been built reflectively on top of AmbientTalk.  The system library shipped with AmbientTalk contains the reflective implemention that adds leased references to the language kernel. This implementation can be found in the file at/lang/leasedrefs.at and /at/lang/leasedrefstrait.at. 
  
 To use the language constructs for leased references, you should import the leasedref module as follows: To use the language constructs for leased references, you should import the leasedref module as follows:
-import /.at.lang.leasedref+<code> 
 +import /.at.lang.leasedrefs
 +</code>
 <note> <note>
-leasedref module exports support primitives to manipulate time intervals (i.e. minutes, seconds, millisecs) so that you do not need to explicitly import the timer module. Remember to exclude those methods from the leasedref import statement if some other module has already imported them, e.g. if futures are enabled.+leasedrefs module exports support primitives to manipulate time intervals (i.e. ''minutes''''seconds''''millisecs'') so that you do not need to explicitly import the timer module. Remember to exclude those methods from the leasedrefs import statement if some other module has already imported them, e.g. if futures are enabled.
 </note> </note>
  
at/tutorial/distribution.txt · Last modified: 2009/01/30 16:13 by tvcutsem