public function yields($keyOrValue = null, $value = null): self
    {
        $argumentCount = func_num_args();

        if ($argumentCount > 1) {
            $hasKey = true;
            $hasValue = true;
            $key = $keyOrValue;
        } elseif ($argumentCount > 0) {
            $hasKey = false;
            $hasValue = true;
            $key = null;
            $value = $keyOrValue;
        } else {
            $hasKey = false;
            $hasValue = false;
            $key = null;
        }

        if ($key instanceof InstanceHandle) {
            $key = $key->get();
        }

        if ($value instanceof InstanceHandle) {
            $value = $value->get();
        }

        $this->iterations[] = new GeneratorYieldIteration(
            $this->requests,
            $hasKey,
            $key,
            $hasValue,
            $value
        );
        $this->requests = [];

        return $this;
    }