DelayedValue.st
changeset 5047 f6ccfe8f2ddb
parent 5036 470d8976544f
child 5051 44da029d521c
--- a/DelayedValue.st	Tue Jun 25 11:06:22 2019 +0200
+++ b/DelayedValue.st	Tue Jun 25 11:07:59 2019 +0200
@@ -44,7 +44,10 @@
     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)
+    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
@@ -56,7 +59,7 @@
         cg
 
     [see also:]
-        Block Lazy LazyValue Future
+        Block Lazy LazyValue Future Promise
 "
 !
 
@@ -108,6 +111,9 @@
 !DelayedValue methodsFor:'printing'!
 
 displayOn:aGCOrStream
+    "notice: displayString and displayOn: will not wait for the value (they are for developers and inspectors),
+     whereas printString and printOn: will wait (they are for the program to print data)."
+
     "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
     "/ ST/X (and some old ST80's) mean: draw-yourself on a GC.
     (aGCOrStream isStream) ifFalse:[
@@ -121,10 +127,13 @@
     ].    
     aGCOrStream nextPutAll:self class name; nextPutAll:' (unevaluated)'
 
-    "Modified (format): / 25-06-2019 / 09:09:58 / Claus Gittinger"
+    "Modified (comment): / 25-06-2019 / 10:46:07 / Claus Gittinger"
 !
 
 displayString
+    "notice: displayString and displayOn: will not wait for the value (they are for developers and inspectors),
+     whereas printString and printOn: will wait (they are for the program to print data)."
+
     "defined here, because I inherit from nobody"
     
     ^ (Object compiledMethodAt:#displayString)
@@ -132,7 +141,7 @@
         arguments:nil
         selector:#displayString
 
-    "Modified: / 25-06-2019 / 09:46:22 / Claus Gittinger"
+    "Modified (comment): / 25-06-2019 / 10:45:54 / Claus Gittinger"
 ! !
 
 !DelayedValue methodsFor:'providing value'!