pike.git / lib / modules / Concurrent.pmod

version» Context lines:

pike.git/lib/modules/Concurrent.pmod:380:    //! 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();    on_failure(p->failure);    on_success(p->success);    call_out(p->try_failure, seconds, ({ "Timeout.\n", backtrace() }));    return p->future();    } +  +  protected string _sprintf(int t) +  { +  return t=='O' && sprintf("%O(%s,%O)", this_program, +  ([ STATE_PENDING : "pending", +  STATE_REJECTED : "rejected", +  STATE_FULFILLED : "fulfilled" ])[state], +  result);    } -  + }      //! 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()]