Promise.st
changeset 5200 06e90979b15b
parent 5199 cf26e97c3bf7
child 5202 5e7ec026714d
equal deleted inserted replaced
5199:cf26e97c3bf7 5200:06e90979b15b
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1993 by Claus Gittinger
     2  COPYRIGHT (c) 1993 by Claus Gittinger
     5 	      All Rights Reserved
     3 	      All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
   104 
   102 
   105     value := anObject.
   103     value := anObject.
   106     valueAvailable signal.
   104     valueAvailable signal.
   107 
   105 
   108     "Modified: / 20-02-2017 / 10:28:23 / stefan"
   106     "Modified: / 20-02-2017 / 10:28:23 / stefan"
   109 !
       
   110 
       
   111 waitForValue
       
   112     "for JavaScript, so that it is different from a  value call
       
   113      and can be back-xlated to an await.
       
   114      Return the value of the promise. 
       
   115      If the evaluation process has not yet finished, wait for it.
       
   116      Otherwise return the value immediately.
       
   117      Any exception which occurred during the evaluation is forwarded to the
       
   118      requestor of the value here."
       
   119 
       
   120     ^ self value
       
   121 ! !
   107 ! !
   122 
   108 
   123 !Promise methodsFor:'initialization'!
   109 !Promise methodsFor:'initialization'!
   124 
   110 
   125 initialize
   111 initialize
   165 
   151 
   166 !Promise class methodsFor:'documentation'!
   152 !Promise class methodsFor:'documentation'!
   167 
   153 
   168 version
   154 version
   169     ^ '$Header$'
   155     ^ '$Header$'
       
   156 !
       
   157 
       
   158 version_CVS
       
   159     ^ '$Header$'
   170 ! !
   160 ! !
   171 
   161