21 lines
574 B
Plaintext
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
|
|
----
|
|
|