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

Create initializeFunction lifecycle hook #25

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

dancfox
Copy link

@dancfox dancfox commented Jun 8, 2021

Add initialization lifecycle hook to UserFunction. This hook is an asynchronous function that honors the await keyword and enables customers to guarantee the completion of async initialization function calls prior to invocation. The lifecycle hook is run a single time prior to the invocation cycle. It is run during the load process, after require and before the handler.

In this version, the lifecycle hook is named by convention as initializeFunction. A possible enhancement to this feature would be to enable customers to customize the name of their initialization hook. This would improve backwards compatibility with existing customer code by helping to prevent namespace collisions.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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

Successfully merging this pull request may close these issues.

1 participant