Branch: Tag:

2016-11-18

2016-11-18 15:00:44 by Stephen R. van den Berg <srb@cuci.nl>

Concurrent: JavaScript API fixes, convenience APIs added.

305:    //! @[on_success()], @[Promise.success()]    //! @[on_failure()], @[Promise.failure()]    //! @url{https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise@} -  inline this_program then(void|function(mixed, mixed ... : mixed) onfulfilled, +  this_program then(void|function(mixed, mixed ... : mixed) onfulfilled,    void|function(mixed, mixed ... : mixed) onrejected,    mixed ... extra) {    Promise p = Promise();
518:   //!   //! @seealso   //! @[race()] - Future first_completed(array(Future) futures) + variant Future first_completed(array(Future) futures)   {    Promise p = FirstCompleted(futures);    return p->future();   } -  + variant inline Future first_completed(Future ... futures) + { +  return first_completed(futures); + }      //! JavaScript Promise API equivalent of @[first_completed()].   //!   //! @seealso   //! @[first_completed()]   //! @url{https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise@} - inline Future race(array(Future) futures) + variant inline Future race(array(Future) futures)   {    return first_completed(futures);   } -  + variant inline Future race(Future ... futures) + { +  return first_completed(futures); + }      protected class Results   {
576:   //!   //! @seealso   //! @[all()] - Future results(array(Future) futures) + variant Future results(array(Future) futures)   {    Promise p = Results(futures);    return p->future();   } -  + inline variant Future results(Future ... futures) + { +  return results(futures); + }      //! JavaScript Promise API equivalent of @[results()].   //!
606:   {    object p = Promise();    p->failure(reason); -  return p; +  return p->future();   }      //! @returns
626:    return value;    object p = Promise();    p->success(value); -  return p; +  return p->future();   }      //! Return a @[Future] that represents the array of mapping @[fun]