mpyw\Co\Internal\ControlUtils::reverse PHP Method

reverse() public static method

Handle success as ControlException, failure as resolved.
public static reverse ( mixed $yieldable ) : Generator
$yieldable mixed
return Generator
    public static function reverse($yieldable)
    {
        try {
            $result = (yield $yieldable);
        } catch (\RuntimeException $e) {
            (yield CoInterface::RETURN_WITH => $e);
        }
        throw new ControlException($result);
    }