pike.git / lib / modules / Concurrent.pmod

version» Context lines:

pike.git/lib/modules/Concurrent.pmod:296:    //!    //! @param extra    //! Any extra context needed for    //! @expr{fun@}. They will be provided    //! as arguments two and onwards when the callback is called.    //!    //! @returns    //! The new @[Future].    //!    //! @note -  //! This method is used if your callbacks returns a regular value (i.e. +  //! This method is used if your callbacks return a regular value (i.e.    //! @b{not@} a @[Future]).    //!    //! @seealso    //! @[recover_with()], @[map()], @[transform()]    this_program recover(function(mixed, mixed ... : mixed) fun,    mixed ... extra)    {    Promise p = Promise();    on_success(p->success);    on_failure(apply, p, fun, extra);
pike.git/lib/modules/Concurrent.pmod:328:    //!    //! @param extra    //! Any extra context needed for    //! @expr{fun@}. They will be provided    //! as arguments two and onwards when the callback is called.    //!    //! @returns    //! The new @[Future].    //!    //! @note -  //! This method is used if your callbacks returns a @[Future] again. +  //! This method is used if your callbacks return a @[Future] again.    //!    //! @seealso    //! @[recover()], @[map_with()], @[transform_with()]    this_program recover_with(function(mixed, mixed ... : this_program) fun,    mixed ... extra)    {    Promise p = Promise();    on_success(p->success);    on_failure(apply_flat, p, fun, extra);    return p->future();
pike.git/lib/modules/Concurrent.pmod:354:    //! or will fail with @[UNDEFINED] if it returns false.    this_program filter(function(mixed, mixed ... : int(0..1)) fun,    mixed ... extra)    {    Promise p = Promise();    on_failure(p->failure);    on_success(apply_filter, p, fun, extra);    return p->future();    }    -  //! Return a @[Future] that will be fulfilled with either -  //! the result of applying @[success] with the fulfilled result -  //! followed by @[extra], or the result of applying @[failure] -  //! with the failed result followed by @[extra]. +  //! This specifies callbacks that allows you to alter the future.    //! -  //! @[failure] defaults to @[success]. +  //! @param success +  //! Function to be called. The first argument will be the +  //! @b{success@} result of @b{this@} @[Future]. +  //! The return value will be the success result of the new @[Future].    //! -  +  //! @param failure +  //! Function to be called. The first argument will be the +  //! @b{failure@} result of @b{this@} @[Future]. +  //! The return value will be the success result of the new @[Future]. +  //! If this callback is omitted, it will default to the same callback as +  //! @expr{success@}. +  //! +  //! @param extra +  //! Any extra context needed for +  //! @expr{success@} and @expr{failure@}. They will be provided +  //! as arguments two and onwards when the callbacks are called. +  //! +  //! @returns +  //! The new @[Future]. +  //!    //! @note -  //! This method is used if your callbacks returns a regular value (i.e. +  //! This method is used if your callbacks return a regular value (i.e.    //! @b{not@} a @[Future]).    //!    //! @seealso    //! @[transform_with()], @[map()], @[recover()]    this_program transform(function(mixed, mixed ... : mixed) success,    function(mixed, mixed ... : mixed)|void failure,    mixed ... extra)    {    Promise p = Promise();    on_success(apply, p, success, extra);    on_failure(apply, p, failure || success, extra);    return p->future();    }    -  //! Return a @[Future] that will be fulfilled with either -  //! the fulfilled result of applying @[success] with the fulfilled result -  //! followed by @[extra], or the fulfilled result of applying @[failure] -  //! with the failed result followed by @[extra]. +  //! This specifies callbacks that allows you to alter the future.    //! -  //! @[failure] defaults to @[success]. +  //! @param success +  //! Function to be called. The first argument will be the +  //! @b{success@} result of @b{this@} @[Future]. +  //! The return value must be a @[Future] that promises +  //! the new result.    //! -  +  //! @param failure +  //! Function to be called. The first argument will be the +  //! @b{failure@} result of @b{this@} @[Future]. +  //! The return value must be a @[Future] that promises +  //! the new success result. +  //! If this callback is omitted, it will default to the same callback as +  //! @expr{success@}. +  //! +  //! @param extra +  //! Any extra context needed for +  //! @expr{success@} and @expr{failure@}. They will be provided +  //! as arguments two and onwards when the callbacks are called. +  //! +  //! @returns +  //! The new @[Future]. +  //!    //! @note -  //! This method is used if your callbacks returns a @[Future] again. +  //! This method is used if your callbacks return a @[Future] again.    //!    //! @seealso    //! @[transform()], @[map_with()], @[recover_with]    this_program transform_with(function(mixed, mixed ... : this_program) success,    function(mixed, mixed ... : this_program)|void failure,    mixed ... extra)    {    Promise p = Promise();    on_success(apply_flat, p, success, extra);    on_failure(apply_flat, p, failure || success, extra);