pike.git / lib / modules / Concurrent.pmod

version» Context lines:

pike.git/lib/modules/Concurrent.pmod:659:    inline this_program thencatch(function(mixed, mixed ... : mixed) onrejected,    mixed ... extra) {    return then(0, onrejected, @extra);    }       //! Return a @[Future] that will either be fulfilled with the fulfilled    //! result of this @[Future], or be failed after @[seconds] have expired.    this_program timeout(int|float seconds)    {    Promise p = promise_factory(); -  on_failure(p->failure); -  on_success(p->success); +  /* NB: try_* variants as the original promise may get fulfilled +  * after the timeout has occurred. +  */ +  on_failure(p->try_failure); +  on_success(p->try_success);    if (timeout_call_out_handle) {    // Remove the previous timeout call_out.    (backend?backend->remove_call_out:remove_call_out)    (timeout_call_out_handle);    }    timeout_call_out_handle = (backend?backend->call_out:call_out)    (p->try_failure, seconds, ({ "Timeout.\n", backtrace() }));    return p->future();    }