pike.git / lib / modules / Concurrent.pmod

version» Context lines:

pike.git/lib/modules/Concurrent.pmod:594:    key = 0;    success(astate[1]);    }       //! Add futures the current promise must accumulate.    //!    //! @param futures    //! The list of all the @expr{futures@} we must accumulate.    //!    //! @seealso -  //! @[Concurrent.fold()], @[fold_finish()] +  //! @[Concurrent.fold()], @[apply_fold()]    void fold(array(Future) futures)    {    if (!astate)    astate = ({});       astate += futures;    }    inline variant void fold(Future ... futures)    {    return fold(futures);
pike.git/lib/modules/Concurrent.pmod:626:    //! If @[fun] throws an error it will fail the @[Future].    //!    //! @note    //! @[fun] may be called in any order, and will be called    //! once for every @[Future] in @[futures], unless one of    //! calls fails in which case no further calls will be    //! performed.    //!    //! @seealso    //! @[Concurrent.fold()], @[fold()] -  void fold_finish(mixed initial, +  void apply_fold(mixed initial,    function(mixed, mixed, mixed ... : mixed) fun,    mixed ... extra)    {    if (!astate || !sizeof(astate)) {    success(initial);    return;    }       array(Future) futures = astate;    astate = 0;
pike.git/lib/modules/Concurrent.pmod:823:   //! once for every @[Future] in @[futures], unless one of   //! calls fails in which case no further calls will be   //! performed.   Future fold(array(Future) futures,    mixed initial,    function(mixed, mixed, mixed ... : mixed) fun,    mixed ... extra)   {    Promise p = Promise();    p->fold(futures); -  p->fold_finish(initial, fun, extra); +  p->apply_fold(initial, fun, extra);    return p->future();   }