|
Class: TimedPromise
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
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.
copyrightCOPYRIGHT (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.
instance creation
-
forMilliseconds: ms
-
accessing
-
ms: msec
-
accessing-parent
-
value
-
Note -- only good for one waiter
private
-
startup
-
Wait for data arrival or alarm expiry.
|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
|
|