/** * Wrap value with the Generator that returns the first result. * If no yieldables found, AllFailedException is thrown. * * @param mixed $value * @return \Generator Resolved value. * @throws \RuntimeException|AllFailedException */ public static function race($value) { (yield Co::RETURN_WITH => (yield ControlUtils::anyOrRace($value, ['\\mpyw\\Co\\Internal\\ControlUtils', 'fail'], 'Co::race() failed.'))); // @codeCoverageIgnoreStart }