You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While in some sense "Lambda is stateless", in practice AWS recommends
Initialize SDK clients and database connections outside of the function handler, and cache static assets locally in the /tmp directory. Subsequent invocations processed by the same instance of your function can reuse these resources. This saves cost by reducing function run time.
If I instance Mangum outside of my function handler, it would be great to have the option for my lifespan asynccontextmanager to run once, e.g. at the onset of the first handler call, rather than on every call. This would support use-cases like caching a database connection per AWS recommendation without resorting to workarounds.
This option would allow treating the model of lifespan to cover the actual lifespan of the Lambda function instance, and so, at least to me, seems like a "natural" mapping of the concept of "lifespan".
The text was updated successfully, but these errors were encountered:
While in some sense "Lambda is stateless", in practice AWS recommends
If I instance Mangum outside of my function handler, it would be great to have the option for my
lifespan
asynccontextmanager to run once, e.g. at the onset of the first handler call, rather than on every call. This would support use-cases like caching a database connection per AWS recommendation without resorting to workarounds.This option would allow treating the model of
lifespan
to cover the actual lifespan of the Lambda function instance, and so, at least to me, seems like a "natural" mapping of the concept of "lifespan".The text was updated successfully, but these errors were encountered: