pike.git / lib / modules / Concurrent.pmod

version» Context lines:

pike.git/lib/modules/Concurrent.pmod:238:    //! array of the fulfilled result of this object followed    //! by the fulfilled results of @[others].    //!    //! @seealso    //! @[results()]    this_program zip(this_program ... others)    {    if (!sizeof(others)) return this_program::this;    return results(({ this_program::this }) + others);    } +  +  //! Return a @[Future] that will be failed when @[seconds] seconds has +  //! passed unless it has already been fullfilled. +  this_program timeout(int|float seconds) +  { +  Promise p = Promise(); +  on_failure(p->failure); +  on_success(p->success); +  call_out(p->maybe_failure, seconds, ({ "Timeout.\n", backtrace() })); +  return p->future();    } -  + }      //! Promise to provide a @[Future] value.   //!   //! Objects of this class are typically kept internal to the   //! code that provides the @[Future] value. The only thing   //! that is directly returned to the user is the return   //! value from @[future()].   //!   //! @seealso   //! @[Future], @[future()]