![]() |
Smalltalk/X WebserverDocumentation of class 'DelayedValue': |
|
|
Class: DelayedValueInheritance:ProtoObject | +--DelayedValue | +--Future
Description:I am similar to a Future, in that I represent an execution in progress, whose value will be required some time in the future. In contrast to a future, which itself spawns a thread to perform the computation, my value comes from an external source (typically, an event or incoming message from an interprocess communication channel). In contrast to a Promise, instances of me can be used interchangable with the promised value (i.e. I will catch DNU, wait for the value and forward the message automatically) I will delay any messages sent to me, until the execution has completed (i.e. the value was provided). This is useful to return values from external sources (print jobs, compile jobs etc.), which can be done in the background and the user can do something else in the meantime. If the computation is finished before the user needs its value, he is not forced to wait. If the computation is unfinished, he has to wait for the remaining time only. Related information:Block Lazy LazyValue Future Promise Class protocol:instance creation
Instance protocol:initialization
Examples:Waits for someon else to provide a value after some time-consuming computation (could be a remote process, sending me an event):
|
|
|
ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sun, 04 Jun 2023 07:23:32 GMT
|