eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TimedPromise':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: TimedPromise


Inheritance:

   Object
   |
   +--Promise
      |
      +--TimedPromise

Package:
stx:libbasic2
Category:
Kernel-Processes
Version:
rev: 1.5 date: 2021/01/20 14:31:49
user: cg
file: TimedPromise.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


A TimedPromise is a Promise with a timeout.
An attempt to read the value of a TimedPromise will wait until the process has finished computing it 
or the specified timeout expires.  
If the process terminates with an exception, an attempt to read the value of the TimedPromise will raise the same exception. 
In case of a timeout the OsNeedRetryError will be raised.

copyright

COPYRIGHT (c) 2004 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

instance creation
o  forMilliseconds: ms


Instance protocol:

accessing
o  ms: msec

accessing-parent
o  value
Note -- only good for one waiter

private
o  startup
Wait for data arrival or alarm expiry.


Examples:


     |p|

     p := TimedPromise forMilliseconds:1000.
     p value:[10000 factorial] priority:Processor activePriority.

     Transcript showCR:'doing something else'.
     p value   
     |p|

     p := TimedPromise forMilliseconds:1000.
     p value:[1000 factorial] priority:Processor activePriority.

     Transcript showCR:'doing something else'.
     p value   
     |p|

     p := TimedPromise forMilliseconds:1000.
     p value:[1000 factorial. ZeroDivide raise] priority:Processor activePriority.

     Transcript showCR:'doing something else'.
     p value   


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sun, 26 May 2024 10:57:27 GMT