startup/shutdown events vs lifecycle #2315
Unanswered
rafalkrupinski
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you all for creating and maintaining Starlette,as a user of FastAPI I really appreciate your work.
I don't have a specific issue with the new API (lifecycle), just a thought that came to me when reading about startup/shutdown deprecation (in fastapi).
If I understand correctly, with startup & shutdown events users could register multiple listeners for both events, i.e. for separating concerns, or listeners provided by third-party plug-ins.
Now with lifecycle, the user can only pass a single context manager, so to achieve the separation of concerns they'd need to create a synthetic context manager that invokes all the other CMs.
Is it a valid concern or am I missing something? Why Starlette doesn't accept a tuple of context managers.
Beta Was this translation helpful? Give feedback.
All reactions