The Trunk: System-tonyg.1054.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-tonyg.1054.mcz

commits-2
Tony Garnock-Jones uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-tonyg.1054.mcz

==================== Summary ====================

Name: System-tonyg.1054
Author: tonyg
Time: 30 January 2019, 5:22:17.31393 pm
UUID: 5089201f-7cb8-47e9-9426-f23c1e92c977
Ancestors: System-mt.1053

Improve promise resolution error handling via #fulfillWith:.

=============== Diff against System-mt.1053 ===============

Item was changed:
  ----- Method: Project>>future:send:at:args: (in category 'futures') -----
  future: receiver send: aSelector at: deltaMSecs args: args
  "Send a message deltaSeconds into the future.  Answers a Promise that will be resolved at some time in the future."
  | pr closure |
  pr := Promise new.
+ closure := [pr fulfillWith: [receiver perform: aSelector withArguments: args]].
- closure := [pr resolveWith: (receiver perform: aSelector withArguments: args)].
  deltaMSecs = 0
  ifTrue: [self addDeferredUIMessage: closure]
  ifFalse: [
  [ (Delay forMilliseconds: deltaMSecs) wait.
  self addDeferredUIMessage:
  closure
  ] forkAt: Processor userSchedulingPriority + 1.
  ].
  ^pr
  !