rspec/rules/S6246/java/rule.adoc
2021-05-12 01:17:24 +00:00

21 lines
574 B
Plaintext

Invoking other Lambdas from a Lambda is a scalability anti-pattern. As the runtime of your function is bounded, waiting for another Lambda to finish executing could cause a timeout.
Alternative solutions include:
* Generating events that can be consumed asynchronously by other Lambdas
* Making the Lambda invocation asynchronous
== Compliant solution
----
InvokeRequest invokeRequest = new InvokeRequest()
.withFunctionName("myFunction");
AWSLambdaAsync client = AWSLambdaAsyncClientBuilder.defaultClient();
client.invokeAsync(request); // Compliant
----