The Lifespan Startup Hook
Open connections once when the server boots.
Boot Once, Use Many Times
Some setup should happen once when your server boots, like opening a database connection, not on every single tool call. 🚀
Meet the Lifespan
The lifespan is a hook that runs startup code before requests arrive, then runs teardown code after the server stops.
All lessons in this course
- The Lifespan Startup Hook
- Share State via App Context
- Access the Context Object
- Clean Shutdown & Resource Release