src/Co.php
public static function wait($value, array $options = [])
    {
        try {
            if (self::$self) {
                throw new \BadMethodCallException('Co::wait() is already running. Use Co::async() instead.');
            }
            self::$self = new self;
            self::$self->options = new CoOption($options);
            self::$self->pool = new Pool(self::$self->options);
            return self::$self->start($value);
        } finally {
            self::$self = null;
        }
        // @codeCoverageIgnoreStart
    }
public static function wait($value, array $options = [])
    {
        try {
            if (self::$self) {
                throw new \BadMethodCallException('Co::wait() is already running. Use Co::async() instead.');
            }
            self::$self = new self;
            self::$self->options = new CoOption($options);
            self::$self->pool = new Pool(self::$self->options);
            return self::$self->start($value);
        } finally {
            self::$self = null;
        }
        // @codeCoverageIgnoreStart
    }
public static function wait ( $ value , array $ options = [ ] ) { try { if ( self :: $ self ) { throw new \ BadMethodCallException ( 'Co::wait() is already running. Use Co::async() instead.' ) ; } self :: $ self = new self ; self :: $ self -> options = new CoOption ( $ options ) ; self :: $ self -> pool = new Pool ( self :: $ self -> options ) ; return self :: $ self -> start ( $ value ) ; } finally { self :: $ self = null ; } // @codeCoverageIgnoreStart }
Wait until value is recursively resolved to return it.
This function call must be atomic.
@param  mixed $value
@param  array $options
@return mixed
Wait until value is recursively resolved to return it . This function call must be atomic .