Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this plugin simulate the Lambda execution model? #363

Closed
lrholmes opened this issue Feb 14, 2018 · 2 comments
Closed

Does this plugin simulate the Lambda execution model? #363

lrholmes opened this issue Feb 14, 2018 · 2 comments
Labels

Comments

@lrholmes
Copy link

I've noticed that my database is being 'connected' with every call to my function. My understanding from reading this AWS article is that any code outside of the specified handler functions, or the 'Execution Context', is maintained in anticipation of further invocations of the function.

Is the behaviour simulated at all in serverless-offline?

@daniel-cottone
Copy link
Collaborator

No, this isn't an exact simulation of the lambda environment. The concept of container reuse for example isn't applicable with serverless-offline; the code for your lambda is re-executed with every request.

If that's something you're looking for you could check out SAM Local: https://github.com/awslabs/aws-sam-local

@lrholmes
Copy link
Author

Ah okay great - I was just looking for confirmation that there wasn't a flaw in my code causing the re-execution, as it would have caused problems in production, but is okay for development I think.

Thanks for your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants