Peter Kronenberg
Peter Kronenberg

Reputation: 1306

Are AWs Lambdas serially reusable in Java

Are AWS Lambdas serially reusable and thread-safe? In other words, can I use class fields to maintain state while the Lambda is running. I don't intend to re-use the state. Any field variables would be re-used and re-set at the next invocation. I just want to make sure that my Lambda won't be executed by multiple threads at the same time.

Upvotes: 0

Views: 33

Answers (1)

stdunbar
stdunbar

Reputation: 17475

Yes, Lambda scales horizontally. It will spin up multiple instances but a particular Lambda is only in use by a single caller at a particular time. Multiple callers would get multiple Lambdas.

Upvotes: 1

Related Questions