3 ms·
We get around this by using a dependency injection framework (e.g. Guice) and initialising the module statically, so it will only get called once when the JVM l
by djhworld 10y ago
We get around this by using a dependency injection framework (e.g. Guice) and initialising the module statically, so it will only get called once when the JVM loads (i.e. when the Lambda 'warms up') and then inject the dependencies into anything that uses them
For example in one Lambda function, we use Guice to get resources from S3.