Azure / azure-functions-python-library

Azure Functions Python SDK
MIT License
150 stars 63 forks source link

Run startup and shutdown before handle http request #142

Open carderne opened 1 year ago

carderne commented 1 year ago

We're using this diff to work with a stac-fastapi app that needs to set up and tear down a DB connection for each request.

I'm not sure how generic this API is supposed to be, but this should definitely work with any Starlette implementation (relevant startup code here.

Fully understand if the scope for this library is broader, I haven't done much due diligence.

tonybaloney commented 1 year ago

Thanks for the PR, there's a lot of edge cases and scenarios to handle, I've submitted a PR, #187 with a full implementation