start() private method

Start resovling.
private start ( mixed $value, boolean $wait = true, mixed $throw = null )
$value mixed
$wait boolean
$throw mixed Used for Co::async() overrides.
Ejemplo n.º 1
0
Archivo: Co.php Proyecto: mpyw/co
 /**
  * Value is recursively resolved, but we never wait it.
  * This function must be called along with Co::wait().
  * @param  mixed $value
  * @param  mixed $throw
  */
 public static function async($value, $throw = null)
 {
     if (!self::$self) {
         throw new \BadMethodCallException('Co::async() must be called along with Co::wait(). ');
     }
     if ($throw !== null) {
         $throw = filter_var($throw, FILTER_VALIDATE_BOOLEAN, ['flags' => FILTER_NULL_ON_FAILURE]);
         if ($throw === null) {
             throw new \InvalidArgumentException("\$throw must be null or boolean.");
         }
     }
     self::$self->start($value, false, $throw);
 }