src/Runtime/LambdaRuntime.php
public function processNextEvent(callable $handler): void
    {
        /** @var Context $context */
        [$event, $context] = $this->waitNextInvocation();

        try {
            $this->sendResponse($context->getAwsRequestId(), $handler($event, $context));
        } catch (\Throwable $e) {
            $this->signalFailure($context->getAwsRequestId(), $e);
        }
    }
public function processNextEvent(callable $handler): void
    {
        /** @var Context $context */
        [$event, $context] = $this->waitNextInvocation();

        try {
            $this->sendResponse($context->getAwsRequestId(), $handler($event, $context));
        } catch (\Throwable $e) {
            $this->signalFailure($context->getAwsRequestId(), $e);
        }
    }
public function processNextEvent ( callable $ handler ) : void { /** @var Context $context */ [ $ event , $ context ] = $ this -> waitNextInvocation ( ) ; try { $ this -> sendResponse ( $ context -> getAwsRequestId ( ) , $ handler ( $ event , $ context ) ) ; } catch ( \ Throwable $ e ) { $ this -> signalFailure ( $ context -> getAwsRequestId ( ) , $ e ) ; } }
Process the next event.

@param callable $handler This callable takes two parameters, an $event parameter (array) and a $context parameter (Context) and must return anything serializable to JSON.

Example:

$lambdaRuntime->processNextEvent(function (array $event, Context $context) {
return 'Hello ' . $event['name'] . '. We have ' . $context->getRemainingTimeInMillis()/1000 . ' seconds left';
});
@throws \Exception
Process the next event .