@param MethodInvocation $invocation

@return object
@throws \Exception
333367
public function invoke(MethodInvocation $invocation)
    {
        /** @var MessageDriven $annotation */
        $annotation = $invocation->getMethod()->getAnnotation($this->annotation);
        $command = new EagerMessage($invocation);
        if ($annotation->value instanceof LazyQueue) {
            $command = new LazyMessage($invocation);
            $command->onQueue($annotation->onQueue)
                ->delay($annotation->value->delay())
                ->onConnection($annotation->mappedName);
        }

        return static::$dispatcher->dispatch($command);
    }
152623
protected function doInvoke(Invocation $invocation)
    {
        $invocation->setAttachments($this->context->getAttachments());

        $startTime = microtime(true);

        try {
            $result = $this->client->request($invocation);

            if (! $result instanceof Result) {
                Log::channel('homer')->warning('Server response an error message', [
                    'result' => (string) $result
                ]);

                throw new CallingException('The invoke result must instance of Result, '
                    .class_basename($result).' given.');
            }
        } catch (Throwable $e) {
            $result = $this->createExceptionResult($e);
        }

        if ($this->isDebug()) {
            $this->logInvoking($invocation, $result, $this->getElapsedTime($startTime));
        }

        return $result;
    }
1317197
public function getInvocationMessage()
    {
        if ($this->invocationMessage === null) {
            // try to create one
            if ($this->registration === null) {
                throw new \Exception('You must set the registration prior to calling getInvocationMessage');
            }

            if ($this->callMessage === null) {
                throw new \Exception('You must set the CallMessage prior to calling getInvocationMessage');
            }

            $invocationMessage = InvocationMessage::createMessageFrom($this->getCallMessage(), $this->getRegistration());

            $invocationMessage->setRequestId($this->getInvocationRequestId());

            $details = [];

            if ($this->getRegistration()->getDiscloseCaller() === true && $this->getCallerSession()->getAuthenticationDetails()) {
                $authenticationDetails = $this->getCallerSession()->getAuthenticationDetails();
                $details               = [
                    'caller'     => $this->getCallerSession()->getSessionId(),
                    'authid'     => $authenticationDetails->getAuthId(),
                    'authrole'   => $authenticationDetails->getAuthRole(),
                    'authroles'  => $authenticationDetails->getAuthRoles(),
                    'authmethod' => $authenticationDetails->getAuthMethod(),
                ];

                if ($authenticationDetails->getAuthExtra() !== null) {
                    $details['_thruway_authextra'] = $authenticationDetails->getAuthExtra();
                }
            }

            // TODO: check to see if callee supports progressive call
            $callOptions   = $this->getCallMessage()->getOptions();
            $isProgressive = false;
            if (is_object($callOptions) && isset($callOptions->receive_progress) && $callOptions->receive_progress) {
                $details       = array_merge($details, ['receive_progress' => true]);
                $isProgressive = true;
            }

            // if nothing was added to details - change ot stdClass so it will serialize correctly
            if (count($details) === 0) {
                $details = new \stdClass();
            }
            $invocationMessage->setDetails($details);

            $this->setIsProgressive($isProgressive);

            $this->setInvocationMessage($invocationMessage);
        }

        return $this->invocationMessage;
    }
550482
protected function _dispatch(Zend_Server_Method_Definition $invocable, array $params)
    {
        $callback = $invocable->getCallback();
        $type     = $callback->getType();

        if ('function' == $type) {
            $function = $callback->getFunction();
            return call_user_func_array($function, $params);
        }

        $class  = $callback->getClass();
        $method = $callback->getMethod();

        if ('static' == $type) {
            return call_user_func_array(array($class, $method), $params);
        }

        $object = $invocable->getObject();
        if (!is_object($object)) {
            $invokeArgs = $invocable->getInvokeArguments();
            if (!empty($invokeArgs)) {
                $reflection = new ReflectionClass($class);
                $object     = $reflection->newInstanceArgs($invokeArgs);
            } else {
                $object = new $class;
            }
        }
        return call_user_func_array(array($object, $method), $params);
    }
1152637
protected function fetchMethodArguments(MethodInvocation $invocation): array
    {
        $result         = [];
        $parameters     = $invocation->getMethod()->getParameters();
        $argumentValues = $invocation->getArguments();

        // Number of arguments can be less than number of parameters because of default values
        foreach ($parameters as $parameterIndex => $reflectionParameter) {
            $hasArgumentValue = \array_key_exists($parameterIndex, $argumentValues);
            $argumentValue    = $hasArgumentValue ? $argumentValues[$parameterIndex] : null;
            if (!$hasArgumentValue && $reflectionParameter->isDefaultValueAvailable()) {
                $argumentValue = $reflectionParameter->getDefaultValue();
            }
            $result[$reflectionParameter->name] = $argumentValue;
        }

        return $result;
    }
137634
public RpcRequest getRequest(final Invocation invocation) {
		if (invocation == null) throw new NullPointerException("invocation");

		MethodDescriptor<?, ?> method = invocation.getMethod();
		if (!method.isTerminal()) {
			throw new IllegalArgumentException("Last invocation method must be terminal");
		}

		RpcRequest request = new RpcRequest(method.isPost() ? RpcRequest.POST : RpcRequest.GET);
		for (Invocation invocation1 : invocation.toChain()) {
			writeInvocation(request, invocation1);
		}

		return request;
	}
839
public function invokeWithin($fn, $args = array())
    {
        $this->invocation_context->activate();

        $this->invocation_context->push($this);
        try {
            $result = call_user_func_array($fn, $args);
            $this->invocation_context->pop();
            $this->invocation_context->deactivate();
            return $result;
        } catch (\Exception $e) {
            $this->invocation_context->pop();
            $this->invocation_context->deactivate();
            throw $e;
        }
    }
964045
public Object invoke(String methodName) {
		IObjectParser parser = container.getObjectParser();
		LOGGER.debug("Calling " + methodName + " on object " + phpSudId);
		String expr = PHPInterpeter.getObject(phpSudId) + "->" + methodName + "()";
		try {
			return parser.parse(expr);
		} catch (PHPException e) {
			LOGGER.error("Unable to get value : " + e.toString());
		}
		return null;
	}
1242235
protected function doInvoke(Invocation $invocation)
    {
        return (new Pipeline($this->container))
            ->send($invocation)
            ->through($this->middleware)
            ->then(function ($invocation) {
                return $this->invoker->invoke($invocation);
            });
    }
113663
public function invoke(MethodInvocation $invocation)
    {
        $annotation = $invocation->getMethod()->getAnnotation($this->annotation);
        $keys = $this->generateCacheName($annotation->cacheName, $invocation);
        if (!is_array($annotation->key)) {
            $annotation->key = [$annotation->key];
        }
        $keys = $this->detectCacheKeys($invocation, $annotation, $keys);
        // detect use cache driver
        $cache = $this->detectCacheRepository($annotation);
        $result = $invocation->proceed();
        if ($result !== null) {
            $cache->put($this->recursiveImplode($this->join, $keys), $result, $annotation->lifetime);
        }

        return $result;
    }
859058
public function invoke(MethodInvocation $invocation)
    {
        /** @var \Ytake\LaravelAspect\Annotation\Loggable $annotation */
        $annotation = $invocation->getMethod()->getAnnotation($this->annotation);
        $start = microtime(true);
        $result = $invocation->proceed();
        $time = number_format(microtime(true) - $start, 15);
        $logFormat = $this->logFormatter($annotation, $invocation);
        $logger = static::$logger;
        if (!$annotation->skipResult) {
            $logFormat['context']['result'] = $result;
        }
        $logFormat['context']['time'] = $time;
        /** Monolog\Logger */
        if ($logger instanceof LogManager) {
            if (!is_null($annotation->driver)) {
                $logger = $logger->driver($annotation->driver);
            }
            $logger->addRecord($logFormat['level'], $logFormat['message'], $logFormat['context']);
        }

        return $result;
    }
927222
public function invokeWith($arguments = [])
    {
        if (!$arguments instanceof Arguments) {
            $arguments = new Arguments($arguments);
        }

        if (!$this->isRecording) {
            return $this->invoker->callWith($this->callback, $arguments);
        }

        $call = $this->callFactory->record($this->callback, $arguments, $this);
        $responseEvent = $call->responseEvent();

        if ($responseEvent instanceof ThrewEvent) {
            $call->setEndEvent($responseEvent);

            throw $responseEvent->exception();
        }

        $returnValue = $responseEvent->value();

        if ($this->useGeneratorSpies && $returnValue instanceof Generator) {
            return $this->generatorSpyFactory->create($call, $returnValue);
        }

        if (
            $this->useIterableSpies &&
            (is_array($returnValue) || $returnValue instanceof Traversable)
        ) {
            return $this->iterableSpyFactory->create($call, $returnValue);
        }

        $call->setEndEvent($call->responseEvent());

        return $returnValue;
    }
30755
public function invoke(MethodInvocation $invocation)
    {
        /** @var \Ytake\LaravelAspect\Annotation\QueryLog $annotation */
        $annotation = $invocation->getMethod()->getAnnotation($this->annotation);
        $this->subscribeQueryLog();
        $result = $invocation->proceed();
        $logFormat = $this->queryLogFormatter($annotation, $invocation);
        $logger = static::$logger;
        if ($logger instanceof LogManager) {
            if (!is_null($annotation->driver)) {
                $logger = $logger->driver($annotation->driver);
            }
            $logger->addRecord($logFormat['level'], $logFormat['message'], $logFormat['context']);
        }
        $this->queryLogs = [];

        return $result;
    }
1325979
private Object getTargetBean(final Invocation invocation)
   {
      final InvocationContext invocationContext = invocation.getInvocationContext();

      return invocationContext.getTargetBean();
   }
302852
public function get(ClientException $exception, MethodInterface $method)
    {
        $map = $this->getMap();
        if ($this->supports($exception, $map)) {
            return $this->create(
                $this->getMappedClass($exception, $map),
                $exception,
                $method
            );
        }

        return $this->create(
            'Cardinity\\Exception\\UnexpectedResponse',
            $exception,
            $method
        );
    }
823770
public function log(MethodInvocation $invocation)
    {
        /**
         * @var $request ServerRequestInterface
         * @var $response ResponseInterface
         */
        $request = $invocation->getArguments()[0];
        $response = $invocation->getArguments()[1];
        try {
            $response = $invocation->proceed();
        } catch (\Exception $ex) {
            $this->logger->critical($ex->getMessage(), $ex->getTrace());
            throw $ex;
        }

        return $response;
    }
226705
@Override
	public Object invoke(final Invocation invocation) throws Exception {
		if (invocation == null) throw new NullPointerException("invocation");

		MethodDescriptor<?, ?> method = invocation.getMethod();
		DataTypeDescriptor<?> resultd = (DataTypeDescriptor<?>) method.getResult();
		MessageDescriptor<? extends Message> excd = descriptor.getExc();

		RpcRequest request = protocol.getRequest(invocation);
		return session.send(request, resultd, excd);
	}