/** * 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); }